From d785ed5a05b3123d95e8627a0f82f0f9cddec33f Mon Sep 17 00:00:00 2001
From: taehoon
Date: Thu, 25 Jul 2019 23:34:56 -0400
Subject: [PATCH] rewrite unit tests
---
test/unit/specs/components/timeline.spec.js | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/test/unit/specs/components/timeline.spec.js b/test/unit/specs/components/timeline.spec.js
index 48796cd398..c1fdd0dd9b 100644
--- a/test/unit/specs/components/timeline.spec.js
+++ b/test/unit/specs/components/timeline.spec.js
@@ -1,5 +1,4 @@
import { getExcludedStatusIdsByPinning } from 'src/components/timeline/timeline.js'
-import { difference } from 'lodash'
describe('Timeline', () => {
describe('getExcludedStatusIdsByPinning', () => {
@@ -8,14 +7,14 @@ describe('Timeline', () => {
it('should not return any unpinned status ids', () => {
const statuses = mockStatuses([1, 2, 3, 4])
const pinnedStatusIds = [1, 3, 5]
- expect(difference(getExcludedStatusIdsByPinning(statuses, pinnedStatusIds), pinnedStatusIds)).to.eql([])
+ expect(pinnedStatusIds).to.include.members(getExcludedStatusIdsByPinning(statuses, pinnedStatusIds))
})
it('should not return any status ids not listed in the given statuses', () => {
const statusIds = [1, 2, 3, 4]
const statuses = mockStatuses(statusIds)
const pinnedStatusIds = [1, 3, 5]
- expect(difference(getExcludedStatusIdsByPinning(statuses, pinnedStatusIds), statusIds)).to.eql([])
+ expect(statusIds).to.include.members(getExcludedStatusIdsByPinning(statuses, pinnedStatusIds))
})
it('should return ids of pinned statuses not posted before any unpinned status', () => {