Skip to content

Commit

Permalink
Remove unused userEvent const use app-development renderWithProviders
Browse files Browse the repository at this point in the history
  • Loading branch information
Jondyr committed Sep 9, 2024
1 parent 7772575 commit 1608731
Showing 1 changed file with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react';
import { render as renderRtl, screen } from '@testing-library/react';
import { screen } from '@testing-library/react';
import userEvent, { PointerEventsCheckLevel } from '@testing-library/user-event';
import type { CreateNewWrapperProps } from './CreateNewWrapper';
import { CreateNewWrapper } from './CreateNewWrapper';
Expand All @@ -8,7 +8,9 @@ import {
dataModel1NameMock,
jsonMetadata1Mock,
} from '../../../../../packages/schema-editor/test/mocks/metadataMocks';
import { renderWithProviders } from '@altinn/ux-editor/testing/mocks';
import { renderWithProviders } from '../../../../test/testUtils';
import { app, org } from '@studio/testing/testids';
import { APP_DEVELOPMENT_BASENAME } from 'app-shared/constants';

// Test data:
const handleCreateSchema = jest.fn();
Expand Down Expand Up @@ -130,7 +132,6 @@ describe('CreateNewWrapper', () => {
});

it('should not call handleCreateSchema callback when trying to create a new model with no name when ok button is clicked', async () => {
const user = userEvent.setup();
const userWithNoPointerEventCheck = userEvent.setup({
pointerEventsCheck: PointerEventsCheckLevel.Never,
});
Expand All @@ -148,4 +149,6 @@ describe('CreateNewWrapper', () => {
});

const render = (props: Partial<CreateNewWrapperProps> = {}) =>
renderWithProviders(<CreateNewWrapper {...defaultProps} {...props} />);
renderWithProviders(<CreateNewWrapper {...defaultProps} {...props} />, {
startUrl: `${APP_DEVELOPMENT_BASENAME}/${org}/${app}/ui-editor`,
});

0 comments on commit 1608731

Please sign in to comment.