Skip to content

Commit

Permalink
fix: test issue
Browse files Browse the repository at this point in the history
  • Loading branch information
Quiddlee committed Dec 31, 2023
1 parent 16065aa commit e2dd030
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/components/Editor/ui/EditorField.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ const EditorField = ({ onChange, value = '', isJson, isReadOnly }: EditorFieldPr
};
}, []);

return <pre ref={editor} />;
return <pre data-testid="editor-field" ref={editor} />;
};

EditorField.displayName = 'EditorField';
Expand Down
4 changes: 2 additions & 2 deletions src/test/NavigationDrawer.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@ describe('NavigationDrawer', () => {
});

it('should navigate to the welcome page when welcome nav item is clicked', async () => {
expect(screen.getAllByTestId('editor-field')).toHaveLength(2);
expect(screen.getAllByTestId('editor-field')).toHaveLength(3);
await userEvent.click(screen.getByTestId('nav-welcome'));
expect(screen.queryByTestId('editor-field')).toBeNull();
});

it('should navigate to the settings page when settings nav item is clicked', async () => {
expect(screen.getAllByTestId('editor-field')).toHaveLength(2);
expect(screen.getAllByTestId('editor-field')).toHaveLength(3);
await userEvent.click(screen.getByTestId('nav-settings'));
expect(screen.queryByTestId('editor-field')).toBeNull();
});
Expand Down

0 comments on commit e2dd030

Please sign in to comment.