mirror of
https://github.com/strapi/strapi.git
synced 2025-08-11 02:07:51 +00:00
Remove testId
This commit is contained in:
parent
6895240a6f
commit
2f480c7ab9
@ -1,5 +1,5 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { act, render, screen } from '@testing-library/react';
|
import { act, render, screen, within } from '@testing-library/react';
|
||||||
import userEvent from '@testing-library/user-event';
|
import userEvent from '@testing-library/user-event';
|
||||||
import { ThemeProvider, lightTheme } from '@strapi/design-system';
|
import { ThemeProvider, lightTheme } from '@strapi/design-system';
|
||||||
import { IntlProvider } from 'react-intl';
|
import { IntlProvider } from 'react-intl';
|
||||||
@ -91,7 +91,9 @@ describe('BulkActionsBar', () => {
|
|||||||
|
|
||||||
await act(async () => {
|
await act(async () => {
|
||||||
await user.click(screen.getByRole('button', { name: /\bpublish\b/i }));
|
await user.click(screen.getByRole('button', { name: /\bpublish\b/i }));
|
||||||
await user.click(screen.getByTestId('confirm-publish'));
|
await user.click(
|
||||||
|
within(screen.getByRole('dialog')).getByRole('button', { name: /\bpublish\b/i })
|
||||||
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
expect(onConfirmPublishAll).toHaveBeenCalledWith([]);
|
expect(onConfirmPublishAll).toHaveBeenCalledWith([]);
|
||||||
@ -103,7 +105,9 @@ describe('BulkActionsBar', () => {
|
|||||||
|
|
||||||
await act(async () => {
|
await act(async () => {
|
||||||
await user.click(screen.getByRole('button', { name: /\bunpublish\b/i }));
|
await user.click(screen.getByRole('button', { name: /\bunpublish\b/i }));
|
||||||
await user.click(screen.getByTestId('confirm-unpublish'));
|
await user.click(
|
||||||
|
within(screen.getByRole('dialog')).getByRole('button', { name: /\bunpublish\b/i })
|
||||||
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
expect(onConfirmUnpublishAll).toHaveBeenCalledWith([]);
|
expect(onConfirmUnpublishAll).toHaveBeenCalledWith([]);
|
||||||
|
@ -31,7 +31,6 @@ const ConfirmDialogPublishAll = ({ isOpen, onToggleDialog, isConfirmButtonLoadin
|
|||||||
onClick={onConfirm}
|
onClick={onConfirm}
|
||||||
variant="secondary"
|
variant="secondary"
|
||||||
startIcon={<Check />}
|
startIcon={<Check />}
|
||||||
data-testid="confirm-publish"
|
|
||||||
loading={isConfirmButtonLoading}
|
loading={isConfirmButtonLoading}
|
||||||
>
|
>
|
||||||
{formatMessage({
|
{formatMessage({
|
||||||
|
@ -38,7 +38,6 @@ const ConfirmDialogUnpublishAll = ({
|
|||||||
onClick={onConfirm}
|
onClick={onConfirm}
|
||||||
variant="secondary"
|
variant="secondary"
|
||||||
startIcon={<Check />}
|
startIcon={<Check />}
|
||||||
data-testid="confirm-unpublish"
|
|
||||||
loading={isConfirmButtonLoading}
|
loading={isConfirmButtonLoading}
|
||||||
>
|
>
|
||||||
{formatMessage({
|
{formatMessage({
|
||||||
|
Loading…
x
Reference in New Issue
Block a user