Skip to content

Commit

Permalink
fix: lint issues
Browse files Browse the repository at this point in the history
  • Loading branch information
navinkarkera committed Sep 30, 2024
1 parent 3fbc93b commit d7444ef
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 10 deletions.
3 changes: 1 addition & 2 deletions src/generic/delete-modal/DeleteModal.jsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { useState } from 'react';
import PropTypes from 'prop-types';
import {
ActionRow,
Expand Down Expand Up @@ -45,7 +44,7 @@ const DeleteModal = ({
}}
labels={{
default: intl.formatMessage(messages.deleteButton),
pending: intl.formatMessage(messages.pendingDeleteButton)
pending: intl.formatMessage(messages.pendingDeleteButton),
}}
/>
</ActionRow>
Expand Down
14 changes: 6 additions & 8 deletions src/library-authoring/components/CollectionCard.test.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import { initializeMocks, render, screen, waitFor, waitForElementToBeRemoved, within } from '../../testUtils';
import userEvent from '@testing-library/user-event';
import type MockAdapter from 'axios-mock-adapter';
import {
initializeMocks, render, screen, waitFor, waitForElementToBeRemoved, within,
} from '../../testUtils';

import { type CollectionHit } from '../../search-manager';
import CollectionCard from './CollectionCard';
Expand Down Expand Up @@ -79,7 +81,7 @@ describe('<CollectionCard />', () => {
// verify confirmation dialog and click on cancel button
let dialog = await screen.findByRole('dialog', { name: 'Delete this collection?' });
expect(dialog).toBeInTheDocument();
let cancelBtn = await screen.findByRole('button', { name: 'Cancel' });
const cancelBtn = await screen.findByRole('button', { name: 'Cancel' });
userEvent.click(cancelBtn);
expect(axiosMock.history.delete.length).toEqual(0);
expect(cancelBtn).not.toBeInTheDocument();
Expand All @@ -93,9 +95,7 @@ describe('<CollectionCard />', () => {
dialog = await screen.findByRole('dialog', { name: 'Delete this collection?' });
const confirmBtn = await within(dialog).findByRole('button', { name: 'Delete' });
userEvent.click(confirmBtn);
await waitForElementToBeRemoved(() => {
return screen.queryByRole('dialog', { name: 'Delete this collection?' })
});
await waitForElementToBeRemoved(() => screen.queryByRole('dialog', { name: 'Delete this collection?' }));

await waitFor(() => {
expect(axiosMock.history.delete.length).toEqual(1);
Expand Down Expand Up @@ -129,9 +129,7 @@ describe('<CollectionCard />', () => {
const dialog = await screen.findByRole('dialog', { name: 'Delete this collection?' });
const confirmBtn = await within(dialog).findByRole('button', { name: 'Delete' });
userEvent.click(confirmBtn);
await waitForElementToBeRemoved(() => {
return screen.queryByRole('dialog', { name: 'Delete this collection?' })
});
await waitForElementToBeRemoved(() => screen.queryByRole('dialog', { name: 'Delete this collection?' }));

await waitFor(() => {
expect(axiosMock.history.delete.length).toEqual(1);
Expand Down

0 comments on commit d7444ef

Please sign in to comment.