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 26, 2024
1 parent 4bf47a2 commit 2ebdce8
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 @@ -65,7 +67,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 @@ -79,9 +81,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 @@ -115,9 +115,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 2ebdce8

Please sign in to comment.