aboutsummaryrefslogtreecommitdiff
path: root/test/unit/specs/components/timeline.spec.js
diff options
context:
space:
mode:
authorHJ <30-hj@users.noreply.git.pleroma.social>2022-02-20 15:11:08 +0000
committerHJ <30-hj@users.noreply.git.pleroma.social>2022-02-20 15:11:08 +0000
commit56616787ec1b8373e5c160c6fe863694a66ca2db (patch)
tree3e38bdb59b6ff7843bf784a8bcbc3656da76858e /test/unit/specs/components/timeline.spec.js
parentd3659b559715b2eebd313c4c19d713e053aaee89 (diff)
parent7b60adb480bdbce856c94164222820fcf8dede02 (diff)
Merge branch 'fix-pinned-statuses' into 'develop'
Fix pinned statuses appearing at the bottom of user timeline Closes #1112 See merge request pleroma/pleroma-fe!1433
Diffstat (limited to 'test/unit/specs/components/timeline.spec.js')
-rw-r--r--test/unit/specs/components/timeline.spec.js27
1 files changed, 0 insertions, 27 deletions
diff --git a/test/unit/specs/components/timeline.spec.js b/test/unit/specs/components/timeline.spec.js
deleted file mode 100644
index 0c8674a8..00000000
--- a/test/unit/specs/components/timeline.spec.js
+++ /dev/null
@@ -1,27 +0,0 @@
-import { getExcludedStatusIdsByPinning } from 'src/components/timeline/timeline.js'
-
-describe('Timeline', () => {
- describe('getExcludedStatusIdsByPinning', () => {
- const mockStatuses = (ids) => ids.map(id => ({ id }))
-
- it('should return only members of both pinnedStatusIds and ids of the given statuses', () => {
- const statusIds = [1, 2, 3, 4]
- const statuses = mockStatuses(statusIds)
- const pinnedStatusIds = [1, 3, 5]
- const result = getExcludedStatusIdsByPinning(statuses, pinnedStatusIds)
- result.forEach(item => {
- expect(item).to.be.oneOf(statusIds)
- expect(item).to.be.oneOf(pinnedStatusIds)
- })
- })
-
- it('should return ids of pinned statuses not posted before any unpinned status', () => {
- const pinnedStatusIdSet1 = ['PINNED1', 'PINNED2']
- const pinnedStatusIdSet2 = ['PINNED3', 'PINNED4']
- const pinnedStatusIds = [...pinnedStatusIdSet1, ...pinnedStatusIdSet2]
- const statusIds = [...pinnedStatusIdSet1, 'UNPINNED1', ...pinnedStatusIdSet2]
- const statuses = mockStatuses(statusIds)
- expect(getExcludedStatusIdsByPinning(statuses, pinnedStatusIds)).to.eql(pinnedStatusIdSet1)
- })
- })
-})