Skip to content

Commit

Permalink
test(react-northstar): scope fake timers usage
Browse files Browse the repository at this point in the history
  • Loading branch information
Hotell committed Apr 26, 2023
1 parent 0c406a7 commit 5913b99
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,6 @@ const getNavigationNavigationItemAtIndexWrapper = (wrapper: ReactWrapper, index:
findIntrinsicElement(wrapper, `.${carouselNavigationItemClassName}`).at(index);
const getButtonWrapper = (wrapper: ReactWrapper): CommonWrapper => findIntrinsicElement(wrapper, `#${buttonName}`);

jest.useFakeTimers();

describe('Carousel', () => {
isConformant(Carousel, {
testPath: __filename,
Expand Down Expand Up @@ -244,6 +242,8 @@ describe('Carousel', () => {
items: items.map(item => ({ key: item.key, icon: { name: 'icon-circle' } })),
};

jest.useFakeTimers();

afterEach(() => {
jest.runAllTimers();
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import { ShorthandValue } from 'src/types';
import { List } from 'src/components/List/List';

jest.dontMock('@fluentui/keyboard-key');
jest.useFakeTimers();

describe('Dropdown', () => {
isConformant(Dropdown, {
Expand Down Expand Up @@ -327,6 +326,7 @@ describe('Dropdown', () => {
});

describe('highlightedIndex', () => {
jest.useFakeTimers();
afterEach(() => {
act(() => {
jest.runAllTimers();
Expand Down Expand Up @@ -1292,6 +1292,7 @@ describe('Dropdown', () => {
});

describe('getA11ySelectionMessage', () => {
jest.useFakeTimers();
afterEach(() => {
jest.runAllTimers();
});
Expand Down

0 comments on commit 5913b99

Please sign in to comment.