Skip to content

Commit

Permalink
fix(metadata-editor): fix failing tests
Browse files Browse the repository at this point in the history
  • Loading branch information
JakubKida committed Sep 24, 2024
1 parent 6f28039 commit 9ae3e54
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ describe('MetadataInstanceEditor', () => {

rerender(<MetadataInstanceEditor {...props} isUnsavedChangesModalOpen={true} />);
const unsavedChangesModal = screen.getByText('Unsaved Changes');

expect(unsavedChangesModal).toBeInTheDocument();

act(() => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -232,12 +232,14 @@ export const MetadataInstanceEditorAddTemplateAgainAfterCancel: StoryObj<typeof

// Check if currently open template is disabled in dropdown
await userEvent.click(addTemplateButton);
expect(templateMetadataOption).toHaveStyle('pointer-events: none;');
const templateMetadataOptionDisabled = canvas.getByRole('option', { name: 'My Template' });
expect(templateMetadataOptionDisabled).toHaveStyle('pointer-events: none;');

// Check if template available again after cancelling
const cancelButton = await canvas.findByRole('button', { name: 'Cancel' });
await userEvent.click(cancelButton);
await userEvent.click(addTemplateButton);
expect(templateMetadataOption).not.toHaveStyle('pointer-events: none;');
const templateMetadataOptionEnabled = canvas.getByRole('option', { name: 'My Template' });
expect(templateMetadataOptionEnabled).not.toHaveStyle('pointer-events: none;');
},
};

0 comments on commit 9ae3e54

Please sign in to comment.