From e380ddb40f21f6e774e7a51d970184c525e754b2 Mon Sep 17 00:00:00 2001 From: Alejandro Celaya Date: Sat, 6 Mar 2021 17:25:09 +0100 Subject: [PATCH] Replaced test by it in tests --- test/servers/Overview.test.tsx | 10 +++++----- test/utils/CopyToClipboardIcon.test.tsx | 2 +- test/utils/dates/DateIntervalDropdownItems.test.tsx | 6 +++--- test/utils/dates/DateIntervalSelector.test.tsx | 2 +- test/utils/dates/DateRangeSelector.test.tsx | 8 ++++---- 5 files changed, 14 insertions(+), 14 deletions(-) diff --git a/test/servers/Overview.test.tsx b/test/servers/Overview.test.tsx index 7827b637..3b29b3e4 100644 --- a/test/servers/Overview.test.tsx +++ b/test/servers/Overview.test.tsx @@ -45,7 +45,7 @@ describe('', () => { afterEach(() => wrapper?.unmount()); - test('cards display loading messages when still loading', () => { + it('displays loading messages when still loading', () => { const wrapper = createWrapper(true); const cards = wrapper.find(CardText); @@ -53,7 +53,7 @@ describe('', () => { cards.forEach((card) => expect(card.html()).toContain('Loading...')); }); - test('amounts are displayed in cards after finishing loading', () => { + it('displays amounts in cards after finishing loading', () => { const wrapper = createWrapper(); const cards = wrapper.find(CardText); @@ -64,21 +64,21 @@ describe('', () => { expect(cards.at(3).html()).toContain(prettify(3)); }); - test('first card displays warning for old shlink versions', () => { + it('displays warning in first card for old shlink versions', () => { const wrapper = createWrapper(); const firstCard = wrapper.find(CardText).first(); expect(firstCard.html()).toContain('Shlink 2.2 is needed'); }); - test('nests complex components', () => { + it('nests complex components', () => { const wrapper = createWrapper(); expect(wrapper.find(CreateShortUrl)).toHaveLength(1); expect(wrapper.find(ShortUrlsTable)).toHaveLength(1); }); - test('links to other sections are displayed', () => { + it('displays links to other sections', () => { const wrapper = createWrapper(); const links = wrapper.find(Link); diff --git a/test/utils/CopyToClipboardIcon.test.tsx b/test/utils/CopyToClipboardIcon.test.tsx index 9f0d709b..86d7a924 100644 --- a/test/utils/CopyToClipboardIcon.test.tsx +++ b/test/utils/CopyToClipboardIcon.test.tsx @@ -13,7 +13,7 @@ describe('', () => { }); afterEach(() => wrapper?.unmount()); - test('expected components are wrapped', () => { + it('wraps expected components', () => { const copyToClipboard = wrapper.find(CopyToClipboard); const icon = wrapper.find(FontAwesomeIcon); diff --git a/test/utils/dates/DateIntervalDropdownItems.test.tsx b/test/utils/dates/DateIntervalDropdownItems.test.tsx index f9d924ba..2d15ebd8 100644 --- a/test/utils/dates/DateIntervalDropdownItems.test.tsx +++ b/test/utils/dates/DateIntervalDropdownItems.test.tsx @@ -14,13 +14,13 @@ describe('', () => { afterEach(jest.clearAllMocks); afterEach(() => wrapper?.unmount()); - test('expected amount of items is rendered', () => { + it('renders expected amount of items', () => { const items = wrapper.find(DropdownItem); expect(items).toHaveLength(DATE_INTERVALS.length); }); - test('expected item is active', () => { + it('sets expected item as active', () => { const items = wrapper.find(DropdownItem); const EXPECTED_ACTIVE_INDEX = 5; @@ -28,7 +28,7 @@ describe('', () => { items.forEach((item, index) => expect(item.prop('active')).toEqual(index === EXPECTED_ACTIVE_INDEX)); }); - test('selecting an element triggers onChange callback', () => { + it('triggers onChange callback when selecting an element', () => { const items = wrapper.find(DropdownItem); items.at(2).simulate('click'); diff --git a/test/utils/dates/DateIntervalSelector.test.tsx b/test/utils/dates/DateIntervalSelector.test.tsx index 51a24f88..94c068d7 100644 --- a/test/utils/dates/DateIntervalSelector.test.tsx +++ b/test/utils/dates/DateIntervalSelector.test.tsx @@ -14,7 +14,7 @@ describe('', () => { }); afterEach(() => wrapper?.unmount()); - test('props are passed down to nested DateIntervalDropdownItems', () => { + it('passes props down to nested DateIntervalDropdownItems', () => { const items = wrapper.find(DateIntervalDropdownItems); const dropdown = wrapper.find(DropdownBtn); diff --git a/test/utils/dates/DateRangeSelector.test.tsx b/test/utils/dates/DateRangeSelector.test.tsx index 35e8ab1a..f26ef990 100644 --- a/test/utils/dates/DateRangeSelector.test.tsx +++ b/test/utils/dates/DateRangeSelector.test.tsx @@ -18,7 +18,7 @@ describe('', () => { afterEach(jest.clearAllMocks); afterEach(() => wrapper?.unmount()); - test('proper amount of items is rendered', () => { + it('renders proper amount of items', () => { const wrapper = createWrapper(); const items = wrapper.find(DropdownItem); const dateIntervalItems = wrapper.find(DateIntervalDropdownItems); @@ -31,7 +31,7 @@ describe('', () => { expect(items.filter('[active]')).toHaveLength(1); }); - test.each([ + it.each([ [ undefined, 1, 0 ], [ 'today' as DateInterval, 0, 1 ], [ 'yesterday' as DateInterval, 0, 1 ], @@ -41,7 +41,7 @@ describe('', () => { [ 'last180days' as DateInterval, 0, 1 ], [ 'last365Days' as DateInterval, 0, 1 ], [{ startDate: moment() }, 0, 0 ], - ])('proper element is active based on provided date range', ( + ])('sets proper element as active based on provided date range', ( initialDateRange, expectedActiveItems, expectedActiveIntervalItems, @@ -56,7 +56,7 @@ describe('', () => { expect(dateIntervalItems).toHaveLength(expectedActiveIntervalItems); }); - test('selecting an element triggers onDatesChange callback', () => { + it('triggers onDatesChange callback when selecting an element', () => { const wrapper = createWrapper(); const item = wrapper.find(DropdownItem).at(0); const dateIntervalItems = wrapper.find(DateIntervalDropdownItems);