Replaced usages of test with it, and updated changelog

This commit is contained in:
Alejandro Celaya
2021-09-20 22:00:34 +02:00
parent 310913b222
commit 44930b8c5f
14 changed files with 42 additions and 41 deletions

View File

@@ -21,24 +21,24 @@ describe('<MainHeader />', () => {
afterEach(() => wrapper?.unmount());
test('ServersDropdown is rendered', () => {
it('renders ServersDropdown', () => {
const wrapper = createWrapper();
expect(wrapper.find(ServersDropdown)).toHaveLength(1);
});
test.each([
it.each([
[ '/foo', false ],
[ '/bar', false ],
[ '/settings', true ],
])('link to settings is only active when current path is settings', (currentPath, isActive) => {
])('sets link to settings as active only when current path is settings', (currentPath, isActive) => {
const wrapper = createWrapper(currentPath);
const settingsLink = wrapper.find(NavLink);
expect(settingsLink.prop('active')).toEqual(isActive);
});
test('expected class is rendered based on the nav bar state', () => {
it('renders expected class based on the nav bar state', () => {
const wrapper = createWrapper();
expect(wrapper.find(NavbarToggler).find(FontAwesomeIcon).prop('className')).toEqual('main-header__toggle-icon');
@@ -50,7 +50,7 @@ describe('<MainHeader />', () => {
expect(wrapper.find(NavbarToggler).find(FontAwesomeIcon).prop('className')).toEqual('main-header__toggle-icon');
});
test('opens Collapse when clicking toggle', () => {
it('opens Collapse when clicking toggle', () => {
const wrapper = createWrapper();
expect(wrapper.find(Collapse).prop('isOpen')).toEqual(false);

View File

@@ -14,7 +14,7 @@ describe('<ShlinkVersionsContainer />', () => {
afterEach(() => wrapper?.unmount());
test.each([
it.each([
[ null, 'text-center' ],
[ Mock.of<NotFoundServer>({ serverNotFound: true }), 'text-center' ],
[ Mock.of<NonReachableServer>({ serverNotReachable: true }), 'text-center' ],

View File

@@ -15,7 +15,7 @@ describe('ImageDownloader', () => {
imageDownloader = new ImageDownloader(axios, windowMock);
});
test('calls URL with response type blob', async () => {
it('calls URL with response type blob', async () => {
get.mockResolvedValue({ data: {} });
await imageDownloader.saveImage('/foo/bar.png', 'my-image.png');