diff options
| author | taehoon <th.dev91@gmail.com> | 2019-07-28 16:55:34 -0400 |
|---|---|---|
| committer | taehoon <th.dev91@gmail.com> | 2019-07-28 16:55:34 -0400 |
| commit | 18a41e785ed85531f032a0aa1b6bfdce5a892fa9 (patch) | |
| tree | 751002679ee4e672b3929b43b07fe61a06063ec7 /test/unit/specs/components/timeline.spec.js | |
| parent | d785ed5a05b3123d95e8627a0f82f0f9cddec33f (diff) | |
update unit test
Diffstat (limited to 'test/unit/specs/components/timeline.spec.js')
| -rw-r--r-- | test/unit/specs/components/timeline.spec.js | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/test/unit/specs/components/timeline.spec.js b/test/unit/specs/components/timeline.spec.js index c1fdd0dd..0c8674a8 100644 --- a/test/unit/specs/components/timeline.spec.js +++ b/test/unit/specs/components/timeline.spec.js @@ -4,17 +4,15 @@ 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', () => { |
