Skip to content

Commit

Permalink
remove acts after merge with main
Browse files Browse the repository at this point in the history
  • Loading branch information
lassopicasso committed Apr 23, 2024
1 parent d96d6b0 commit 359ac98
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,6 @@ describe('PolicyTab', () => {
const user = userEvent.setup();
await resolveAndWaitForSpinnerToDisappear();

// Fix to remove act error
await user.tab();

const elementInPolicyEditor = screen.getByText(
Expand Down
4 changes: 0 additions & 4 deletions frontend/packages/policy-editor/src/PolicyEditor.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ describe('PolicyEditor', () => {
textMock('policy_editor.alert', { usageType: textMock('policy_editor.alert_resource') }),
);

// Fix to remove act error
await user.tab();

expect(alertTextApp).toBeInTheDocument();
Expand All @@ -63,7 +62,6 @@ describe('PolicyEditor', () => {
textMock('policy_editor.alert', { usageType: textMock('policy_editor.alert_resource') }),
);

// Fix to remove act error
await user.tab();

expect(alertTextApp).not.toBeInTheDocument();
Expand Down Expand Up @@ -114,7 +112,6 @@ describe('PolicyEditor', () => {
textMock('policy_editor.rule_card_sub_resource_title'),
);

// Fix to remove act error
await user.tab();

expect(aLabelFromPolicyCard.length).toEqual(mockPolicy.rules.length);
Expand All @@ -128,7 +125,6 @@ describe('PolicyEditor', () => {
textMock('policy_editor.rule_card_sub_resource_title'),
);

// Fix to remove act error
await user.tab();

expect(aLabelFromPolicyCard.length).toEqual(0);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ describe('ProcessEditor', () => {
const user = userEvent.setup();
renderProcessEditor();

// Fix to remove act error
await user.tab();

const alertHeader = screen.queryByRole('heading', {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ describe('Viewer', () => {
</BpmnContextProvider>,
);

// Fix to remove act error
await user.tab();

const alertTitle = screen.getByRole('link', { name: 'Powered by bpmn.io' });
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ describe('Viewer', () => {
const user = userEvent.setup();
render(<BPMNViewerErrorAlert bpmnViewerError='noDiagram' />);

// Fix to remove act error
await user.tab();

const heading = screen.getByRole('heading', {
Expand All @@ -27,7 +26,6 @@ describe('Viewer', () => {
const user = userEvent.setup();
render(<BPMNViewerErrorAlert bpmnViewerError='noProcess' />);

// Fix to remove act error
await user.tab();

const heading = screen.getByRole('heading', {
Expand All @@ -43,7 +41,6 @@ describe('Viewer', () => {
const user = userEvent.setup();
render(<BPMNViewerErrorAlert bpmnViewerError='unknown' />);

// Fix to remove act error
await user.tab();

const heading = screen.getByRole('heading', {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import type { IGenericEditComponent } from '../../componentConfig';
import { renderWithProviders } from '../../../../testing/mocks';
import { AttachmentListComponent } from './AttachmentListComponent';
import React from 'react';
import { screen, act, waitFor } from '@testing-library/react';
import { screen, waitFor } from '@testing-library/react';
import userEvent from '@testing-library/user-event';
import { createQueryClientMock } from 'app-shared/mocks/queryClientMock';
import { textMock } from '../../../../../../../testing/mocks/i18nMock';
Expand Down Expand Up @@ -133,15 +133,15 @@ describe('AttachmentListComponent', () => {
name: textMock('ux_editor.component_properties.select_pdf'),
});

await act(() => user.click(includePdfCheckbox));
await user.click(includePdfCheckbox);
expect(includePdfCheckbox).toBeChecked();
expect(handleComponentChange).toHaveBeenCalledWith({
...defaultComponent,
dataTypeIds: ['test3', 'test4', reservedDataTypes.refDataAsPdf],
});
expect(handleComponentChange).toHaveBeenCalledTimes(1);

await act(() => user.click(includePdfCheckbox));
await user.click(includePdfCheckbox);
expect(includePdfCheckbox).not.toBeChecked();
expect(handleComponentChange).toHaveBeenCalledWith({
...defaultComponent,
Expand Down Expand Up @@ -186,7 +186,7 @@ describe('AttachmentListComponent', () => {
name: textMock('ux_editor.component_properties.current_task'),
});

await act(() => user.click(currentTaskCheckbox));
await user.click(currentTaskCheckbox);
expect(currentTaskCheckbox).toBeChecked();

expect(handleComponentChange).toHaveBeenCalledWith({
Expand All @@ -196,7 +196,7 @@ describe('AttachmentListComponent', () => {
// Combobox is also triggered, because current task is set to true and makes the combobox to trigger onChangeValue because of filter update
expect(handleComponentChange).toHaveBeenCalledTimes(2);

await act(() => user.click(currentTaskCheckbox));
await user.click(currentTaskCheckbox);
expect(currentTaskCheckbox).not.toBeChecked();
expect(handleComponentChange).toHaveBeenCalledWith({
...defaultComponent,
Expand Down Expand Up @@ -224,7 +224,7 @@ describe('AttachmentListComponent', () => {
name: textMock('ux_editor.component_properties.current_task'),
});

await act(() => user.click(currentTaskCheckbox));
await user.click(currentTaskCheckbox);
expect(currentTaskCheckbox).toBeChecked();

expect(handleComponentChange).not.toHaveBeenCalled();
Expand All @@ -248,7 +248,7 @@ describe('AttachmentListComponent', () => {
const selectAllCheckbox = screen.getByRole('checkbox', {
name: textMock('ux_editor.component_properties.select_all_attachments'),
});
await act(() => user.click(selectAllCheckbox));
await user.click(selectAllCheckbox);
expect(selectAllCheckbox).toBeChecked();
// Combobox is also triggered, because current task is set to true and makes the combobox to trigger onChangeValue because of filter update
expect(handleComponentChange).toHaveBeenCalledWith({
Expand All @@ -258,7 +258,7 @@ describe('AttachmentListComponent', () => {
expect(handleComponentChange).toHaveBeenCalledTimes(2);

handleComponentChange.mockClear();
await act(() => user.click(selectAllCheckbox));
await user.click(selectAllCheckbox);
expect(selectAllCheckbox).not.toBeChecked();

expect(handleComponentChange).not.toHaveBeenCalled();
Expand Down

0 comments on commit 359ac98

Please sign in to comment.