Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F85825472
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Authored By
Unknown
Size
1 KB
Referenced Files
None
Subscribers
None
View Options
diff --git a/test/unit/specs/components/timeline.spec.js b/test/unit/specs/components/timeline.spec.js
index c1fdd0dd9b..0c8674a844 100644
--- a/test/unit/specs/components/timeline.spec.js
+++ b/test/unit/specs/components/timeline.spec.js
@@ -1,29 +1,27 @@
import { getExcludedStatusIdsByPinning } from 'src/components/timeline/timeline.js'
describe('Timeline', () => {
describe('getExcludedStatusIdsByPinning', () => {
const mockStatuses = (ids) => ids.map(id => ({ id }))
- it('should not return any unpinned status ids', () => {
- const statuses = mockStatuses([1, 2, 3, 4])
- const pinnedStatusIds = [1, 3, 5]
- expect(pinnedStatusIds).to.include.members(getExcludedStatusIdsByPinning(statuses, pinnedStatusIds))
- })
-
- it('should not return any status ids not listed in the given statuses', () => {
+ 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]
- expect(statusIds).to.include.members(getExcludedStatusIdsByPinning(statuses, pinnedStatusIds))
+ 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)
})
})
})
File Metadata
Details
Attached
Mime Type
text/x-diff
Expires
Fri, Oct 30, 1:01 AM (1 d, 14 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1799052
Default Alt Text
(1 KB)
Attached To
Mode
rPUFE pleroma-fe-upstream
Attached
Detach File
Event Timeline