Skip to content

Commit

Permalink
test: update code to remove react-hooks
Browse files Browse the repository at this point in the history
  • Loading branch information
dcoa committed Feb 25, 2025
1 parent d77e19f commit 79d5aa0
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 12 deletions.
8 changes: 4 additions & 4 deletions src/react/AppProvider.test.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -204,11 +204,11 @@ describe('AppProvider', () => {
</AppContext.Consumer>
</AppProvider>
);
render(Component);
expect(screen.getByText('Is theme loaded: yes')).toBeInTheDocument();
expect(screen.getByText('Current theme variant: light')).toBeInTheDocument();
const wrapper = render(Component);
expect(wrapper.getByText('Is theme loaded: yes')).toBeInTheDocument();
expect(wrapper.getByText('Current theme variant: light')).toBeInTheDocument();

const setThemeVariantBtn = screen.getByRole('button', { name: 'Set theme variant' });
const setThemeVariantBtn = wrapper.getByRole('button', { name: 'Set theme variant' });
expect(setThemeVariantBtn).toBeInTheDocument();
await userEvent.click(setThemeVariantBtn);

Expand Down
2 changes: 1 addition & 1 deletion src/react/hooks/paragon/useParagonTheme.test.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { act, renderHook } from '@testing-library/react-hooks';
import { act, renderHook } from '@testing-library/react';

import useParagonTheme from './useParagonTheme';
import { getConfig } from '../../../config';
Expand Down
2 changes: 1 addition & 1 deletion src/react/hooks/paragon/useParagonThemeCore.test.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { renderHook, act } from '@testing-library/react-hooks';
import { renderHook, act } from '@testing-library/react';

import { getConfig } from '../../../config';
import { logError, logInfo } from '../../../logging';
Expand Down
2 changes: 1 addition & 1 deletion src/react/hooks/paragon/useParagonThemeUrls.test.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { renderHook } from '@testing-library/react-hooks';
import { renderHook } from '@testing-library/react';

import useParagonThemeUrls from './useParagonThemeUrls';
import { mergeConfig } from '../../../config';
Expand Down
2 changes: 1 addition & 1 deletion src/react/hooks/paragon/useParagonThemeVariants.test.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { act, renderHook } from '@testing-library/react-hooks';
import { act, renderHook } from '@testing-library/react';

import { getConfig } from '../../../config';
import { logError, logInfo } from '../../../logging';
Expand Down
4 changes: 0 additions & 4 deletions src/react/hooks/paragon/useTrackColorSchemeChoice.test.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
import { renderHook } from '@testing-library/react';
import { useTrackColorSchemeChoice } from './hooks';
import { sendTrackEvent } from '../analytics';

import { sendTrackEvent } from '../../../analytics';

import useTrackColorSchemeChoice from './useTrackColorSchemeChoice';

jest.mock('../../../analytics', () => ({
Expand Down

0 comments on commit 79d5aa0

Please sign in to comment.