diff --git a/package.json b/package.json index cb24a0eaa6faad..c4f2c3faefd969 100644 --- a/package.json +++ b/package.json @@ -74,14 +74,14 @@ "@microsoft/load-themed-styles": "1.10.26", "@microsoft/loader-load-themed-styles": "2.0.17", "@microsoft/tsdoc": "0.14.2", - "@nx/devkit": "19.5.7", - "@nx/eslint": "19.5.7", - "@nx/eslint-plugin": "19.5.7", - "@nx/jest": "19.5.7", - "@nx/js": "19.5.7", - "@nx/node": "19.5.7", - "@nx/plugin": "19.5.7", - "@nx/workspace": "19.5.7", + "@nx/devkit": "19.7.3", + "@nx/eslint": "19.7.3", + "@nx/eslint-plugin": "19.7.3", + "@nx/jest": "19.7.3", + "@nx/js": "19.7.3", + "@nx/node": "19.7.3", + "@nx/plugin": "19.7.3", + "@nx/workspace": "19.7.3", "@octokit/rest": "18.12.0", "@phenomnomnominal/tsquery": "6.1.3", "@playwright/test": "1.44.0", @@ -143,7 +143,7 @@ "@types/gulp-remember": "0.0.31", "@types/gulp-sourcemaps": "0.0.35", "@types/gulp-util": "3.0.36", - "@types/jest": "29.5.5", + "@types/jest": "29.5.13", "@types/jest-axe": "3.5.9", "@types/jju": "1.4.1", "@types/json-schema": "^7.0.8", @@ -278,7 +278,7 @@ "monosize-bundler-webpack": "0.1.5", "monosize-storage-azure": "0.0.15", "node-plop": "0.25.0", - "nx": "19.5.7", + "nx": "19.7.3", "p-queue": "6.6.2", "parse-diff": "0.7.1", "path-browserify": "1.0.1", diff --git a/packages/fluentui/react-bindings/test/FocusZone/FocusZone-test.tsx b/packages/fluentui/react-bindings/test/FocusZone/FocusZone-test.tsx index 478c9e48cc4b14..532dada4db2a0c 100644 --- a/packages/fluentui/react-bindings/test/FocusZone/FocusZone-test.tsx +++ b/packages/fluentui/react-bindings/test/FocusZone/FocusZone-test.tsx @@ -1482,7 +1482,7 @@ describe('FocusZone', () => { const innerFocusZone = focusZone.querySelector('.innerFocusZone') as HTMLElement; ReactTestUtils.Simulate.keyDown(innerFocusZone, { which: keyboardKey.Enter }); - expect(keyDownHandler).toBeCalled(); + expect(keyDownHandler).toHaveBeenCalled(); }); it('can call onActiveItemChanged when the active item is changed', () => { diff --git a/packages/fluentui/react-bindings/test/context-selector/useContextSelector-test.tsx b/packages/fluentui/react-bindings/test/context-selector/useContextSelector-test.tsx index 5fc90d005b0e5b..706c979e43900a 100644 --- a/packages/fluentui/react-bindings/test/context-selector/useContextSelector-test.tsx +++ b/packages/fluentui/react-bindings/test/context-selector/useContextSelector-test.tsx @@ -52,28 +52,28 @@ describe('useContextSelector', () => { }); expect(document.querySelector('.test-component')?.dataset.active).toBe('false'); - expect(onUpdate).toBeCalledTimes(1); + expect(onUpdate).toHaveBeenCalledTimes(1); // Match => update, (v.index: 1, p.index: 1) act(() => { document.querySelector('.test-provider')?.click(); }); expect(document.querySelector('.test-component')?.dataset.active).toBe('true'); - expect(onUpdate).toBeCalledTimes(2); + expect(onUpdate).toHaveBeenCalledTimes(2); // No match, but update because "active" changed, (v.index: 2, p.index: 1) act(() => { document.querySelector('.test-provider')?.click(); }); expect(document.querySelector('.test-component')?.dataset.active).toBe('false'); - expect(onUpdate).toBeCalledTimes(3); + expect(onUpdate).toHaveBeenCalledTimes(3); // Match previous => no update, (v.index: 3, p.index: 1) act(() => { document.querySelector('.test-provider')?.click(); }); expect(document.querySelector('.test-component')?.dataset.active).toBe('false'); - expect(onUpdate).toBeCalledTimes(3); + expect(onUpdate).toHaveBeenCalledTimes(3); }); it('updates are propogated inside React.memo()', () => { @@ -95,6 +95,6 @@ describe('useContextSelector', () => { document.querySelector('.test-provider')?.click(); }); expect(document.querySelector('.test-component')?.dataset.active).toBe('true'); - expect(onUpdate).toBeCalledTimes(2); + expect(onUpdate).toHaveBeenCalledTimes(2); }); }); diff --git a/packages/fluentui/react-bindings/test/context-selector/useContextSelectors-test.tsx b/packages/fluentui/react-bindings/test/context-selector/useContextSelectors-test.tsx index 4e38952bfeec2c..2f1f93dd969b71 100644 --- a/packages/fluentui/react-bindings/test/context-selector/useContextSelectors-test.tsx +++ b/packages/fluentui/react-bindings/test/context-selector/useContextSelectors-test.tsx @@ -74,7 +74,7 @@ describe('useContextSelectors', () => { expect(document.querySelector('.test-component')?.dataset.active).toBe('false'); expect(document.querySelector('.test-component')?.dataset.value).toBe('foo'); - expect(onUpdate).toBeCalledTimes(1); + expect(onUpdate).toHaveBeenCalledTimes(1); // No match, (v.index: 2, p.index: 1) act(() => { @@ -85,7 +85,7 @@ describe('useContextSelectors', () => { }); expect(document.querySelector('.test-component')?.dataset.active).toBe('false'); expect(document.querySelector('.test-component')?.dataset.value).toBe('foo'); - expect(onUpdate).toBeCalledTimes(1); + expect(onUpdate).toHaveBeenCalledTimes(1); // // Match => update, (v.index: 1, p.index: 1) act(() => { @@ -96,7 +96,7 @@ describe('useContextSelectors', () => { }); expect(document.querySelector('.test-component')?.dataset.active).toBe('true'); expect(document.querySelector('.test-component')?.dataset.value).toBe('foo'); - expect(onUpdate).toBeCalledTimes(2); + expect(onUpdate).toHaveBeenCalledTimes(2); // // Match previous => no update, (v.index: 1, p.index: 1) act(() => { @@ -107,7 +107,7 @@ describe('useContextSelectors', () => { }); expect(document.querySelector('.test-component')?.dataset.active).toBe('true'); expect(document.querySelector('.test-component')?.dataset.value).toBe('foo'); - expect(onUpdate).toBeCalledTimes(2); + expect(onUpdate).toHaveBeenCalledTimes(2); // Match => update, (v.value: 'bar') act(() => { @@ -117,7 +117,7 @@ describe('useContextSelectors', () => { document.querySelector('.change-value')?.click(); }); expect(document.querySelector('.test-component')?.dataset.value).toBe('bar'); - expect(onUpdate).toBeCalledTimes(3); + expect(onUpdate).toHaveBeenCalledTimes(3); }); it('updates are propogated inside React.memo()', () => { @@ -140,6 +140,6 @@ describe('useContextSelectors', () => { document.querySelector('.change-value')?.click(); }); expect(document.querySelector('.test-component')?.dataset.active).toBe('true'); - expect(onUpdate).toBeCalledTimes(2); + expect(onUpdate).toHaveBeenCalledTimes(2); }); }); diff --git a/packages/fluentui/react-bindings/test/hooks/useAccessibility-test.tsx b/packages/fluentui/react-bindings/test/hooks/useAccessibility-test.tsx index 9cd102714c6b6e..fdcfc7e8d651e1 100644 --- a/packages/fluentui/react-bindings/test/hooks/useAccessibility-test.tsx +++ b/packages/fluentui/react-bindings/test/hooks/useAccessibility-test.tsx @@ -234,15 +234,15 @@ describe('useAccessibility', () => { keyCode: keyboardKey.ArrowDown, }); - expect(onKeyDown).toBeCalledTimes(1); - expect(onKeyDown).toBeCalledWith( + expect(onKeyDown).toHaveBeenCalledTimes(1); + expect(onKeyDown).toHaveBeenCalledWith( expect.objectContaining({ keyCode: keyboardKey.ArrowDown, }), ); - expect(onClick).toBeCalledTimes(1); - expect(onClick).toBeCalledWith( + expect(onClick).toHaveBeenCalledTimes(1); + expect(onClick).toHaveBeenCalledWith( expect.objectContaining({ keyCode: keyboardKey.ArrowDown, }), @@ -255,7 +255,7 @@ describe('useAccessibility', () => { const wrapper = mount(); wrapper.find('div').simulate('keydown'); - expect(onKeyDown).toBeCalledTimes(1); + expect(onKeyDown).toHaveBeenCalledTimes(1); }); it('do not add any handlers by default', () => { @@ -291,7 +291,7 @@ describe('useAccessibility', () => { keyCode: keyboardKey.ArrowDown, }); - expect(onClick).toBeCalledTimes(2); + expect(onClick).toHaveBeenCalledTimes(2); }); it('handlers are referentially stable', () => { @@ -315,8 +315,8 @@ describe('useAccessibility', () => { wrapper.setProps({ onKeyDown: undefined }); wrapper.find('div').simulate('keydown'); - expect(prevOnKeyDown).toBeCalledTimes(1); - expect(nextOnKeyDown).toBeCalledTimes(1); + expect(prevOnKeyDown).toHaveBeenCalledTimes(1); + expect(nextOnKeyDown).toHaveBeenCalledTimes(1); }); describe('FocusZone', () => { diff --git a/packages/fluentui/react-bindings/test/hooks/useAutoControlled-test.tsx b/packages/fluentui/react-bindings/test/hooks/useAutoControlled-test.tsx index fcaca51b8e9282..923f1a3a6fd8d5 100644 --- a/packages/fluentui/react-bindings/test/hooks/useAutoControlled-test.tsx +++ b/packages/fluentui/react-bindings/test/hooks/useAutoControlled-test.tsx @@ -142,6 +142,6 @@ describe('useAutoControlled', () => { act(() => { result.current[1](dispatchSpy); }); - expect(dispatchSpy).toBeCalledWith('b'); + expect(dispatchSpy).toHaveBeenCalledWith('b'); }); }); diff --git a/packages/fluentui/react-bindings/test/hooks/useStyles-test.tsx b/packages/fluentui/react-bindings/test/hooks/useStyles-test.tsx index 641b40eb48ef62..f5f8950728d212 100644 --- a/packages/fluentui/react-bindings/test/hooks/useStyles-test.tsx +++ b/packages/fluentui/react-bindings/test/hooks/useStyles-test.tsx @@ -67,7 +67,7 @@ describe('useStyles', () => { wrappingComponentProps: { value: { performance: {}, theme: createTheme(styles) } }, }); - expect(styles).not.toBeCalled(); + expect(styles).not.toHaveBeenCalled(); }); }); @@ -79,7 +79,7 @@ describe('useStyles', () => { wrappingComponentProps: { value: { performance: {}, theme: createTheme(styles) } }, }); - expect(styles).toBeCalledWith( + expect(styles).toHaveBeenCalledWith( expect.objectContaining({ props: { color: 'green' }, }), diff --git a/packages/fluentui/react-bindings/test/styles/resolveStyles-test.ts b/packages/fluentui/react-bindings/test/styles/resolveStyles-test.ts index 02d67ca284c5c5..9200d9568aa720 100644 --- a/packages/fluentui/react-bindings/test/styles/resolveStyles-test.ts +++ b/packages/fluentui/react-bindings/test/styles/resolveStyles-test.ts @@ -99,7 +99,7 @@ describe('resolveStyles', () => { const { resolvedStyles } = resolveStyles(resolveStylesOptions({ renderRule }), resolvedVariables); expect(resolvedStyles.root).toMatchObject({ color: 'red' }); - expect(renderRule).not.toBeCalled(); + expect(renderRule).not.toHaveBeenCalled(); }); test('renders classes when slot classes getter is accessed', () => { diff --git a/packages/fluentui/react-component-event-listener/test/EventListener-test.tsx b/packages/fluentui/react-component-event-listener/test/EventListener-test.tsx index 3876fd248180f6..b43dd152520300 100644 --- a/packages/fluentui/react-component-event-listener/test/EventListener-test.tsx +++ b/packages/fluentui/react-component-event-listener/test/EventListener-test.tsx @@ -120,7 +120,7 @@ describe('EventListener', () => { , ); - expect(onError).toBeCalledWith( + expect(onError).toHaveBeenCalledWith( expect.objectContaining({ message: '`target` and `targetRef` props are mutually exclusive, please use one of them.', }), @@ -141,7 +141,7 @@ describe('EventListener', () => { , ); - expect(onError).toBeCalledWith( + expect(onError).toHaveBeenCalledWith( expect.objectContaining({ message: "`target` and `targetRef` props are `undefined`, it' required to use one of them.", }), diff --git a/packages/fluentui/react-component-nesting-registry/test/NestingAuto-test.tsx b/packages/fluentui/react-component-nesting-registry/test/NestingAuto-test.tsx index 34abb15c7bb0cb..04202ada87d737 100644 --- a/packages/fluentui/react-component-nesting-registry/test/NestingAuto-test.tsx +++ b/packages/fluentui/react-component-nesting-registry/test/NestingAuto-test.tsx @@ -17,7 +17,7 @@ describe('NestingAuto', () => { mount({children}); const getRefs = children.mock.calls[0][0]; - expect(children).toBeCalledWith( + expect(children).toHaveBeenCalledWith( expect.any(Function), expect.objectContaining({ current: expect.objectContaining({ tagName: 'DIV' }) }), ); diff --git a/packages/fluentui/react-component-ref/test/handleRef-test.ts b/packages/fluentui/react-component-ref/test/handleRef-test.ts index 1746b4f1b735f4..5fe4b4849e0044 100644 --- a/packages/fluentui/react-component-ref/test/handleRef-test.ts +++ b/packages/fluentui/react-component-ref/test/handleRef-test.ts @@ -8,7 +8,7 @@ describe('handleRef', () => { expect(() => { // handleRef() does not accept string, but in this test we want ensure that this case will be handled handleRef('ref' as any, node); - }).toThrowError(); + }).toThrow(); }); it('calls with node when "ref" is function', () => { @@ -16,7 +16,7 @@ describe('handleRef', () => { const node = document.createElement('div'); handleRef(ref, node); - expect(ref).toBeCalledWith(node); + expect(ref).toHaveBeenCalledWith(node); }); it('does not do anything when "ref" is null', () => { @@ -24,7 +24,7 @@ describe('handleRef', () => { expect(() => { handleRef(null, node); - }).not.toThrowError(); + }).not.toThrow(); }); it('assigns to "current" when "ref" is object', () => { diff --git a/packages/fluentui/react-northstar-fela-renderer/test/felaFocusVisibleEnhancer-test.ts b/packages/fluentui/react-northstar-fela-renderer/test/felaFocusVisibleEnhancer-test.ts index b70b06d8dd51b1..3925a3a1868b4a 100644 --- a/packages/fluentui/react-northstar-fela-renderer/test/felaFocusVisibleEnhancer-test.ts +++ b/packages/fluentui/react-northstar-fela-renderer/test/felaFocusVisibleEnhancer-test.ts @@ -26,7 +26,7 @@ describe('felaFocusVisibleEnhancer', () => { renderer.subscribe(subscription); renderer.renderRule(() => ({ ':focus-visible': { borderColor: 'red' } } as any), null); - expect(subscription).toBeCalledWith( + expect(subscription).toHaveBeenCalledWith( expect.objectContaining({ pseudo: ':focus', selector: 'html[data-whatinput="keyboard"] .a:focus', diff --git a/packages/fluentui/react-northstar-fela-renderer/test/felaSanitizeCssPlugin-test.ts b/packages/fluentui/react-northstar-fela-renderer/test/felaSanitizeCssPlugin-test.ts index daf7ee4b7c0184..ea21118cc0aaf9 100644 --- a/packages/fluentui/react-northstar-fela-renderer/test/felaSanitizeCssPlugin-test.ts +++ b/packages/fluentui/react-northstar-fela-renderer/test/felaSanitizeCssPlugin-test.ts @@ -98,6 +98,6 @@ describe('felaSanitizeCssPlugin', () => { const onWarn = jest.spyOn(console, 'warn').mockImplementation(() => {}); sanitize({ backgroundImage: 'url(../../' }); - expect(onWarn).toBeCalledWith(expect.stringMatching(/was passed to property/)); + expect(onWarn).toHaveBeenCalledWith(expect.stringMatching(/was passed to property/)); }); }); diff --git a/packages/fluentui/react-northstar/test/specs/commonTests/handlesAccessibility.tsx b/packages/fluentui/react-northstar/test/specs/commonTests/handlesAccessibility.tsx index c924e64db527a2..a3d0e8671b31c4 100644 --- a/packages/fluentui/react-northstar/test/specs/commonTests/handlesAccessibility.tsx +++ b/packages/fluentui/react-northstar/test/specs/commonTests/handlesAccessibility.tsx @@ -118,7 +118,7 @@ export const handlesAccessibility = ( }); }); - expect(eventHandler).toBeCalledTimes(1); + expect(eventHandler).toHaveBeenCalledTimes(1); }); } }; diff --git a/packages/fluentui/react-northstar/test/specs/commonTests/isConformant.tsx b/packages/fluentui/react-northstar/test/specs/commonTests/isConformant.tsx index 0966bd2232c75f..02166f50b9b9cd 100644 --- a/packages/fluentui/react-northstar/test/specs/commonTests/isConformant.tsx +++ b/packages/fluentui/react-northstar/test/specs/commonTests/isConformant.tsx @@ -326,7 +326,7 @@ export function isConformant( const wrapper = mount(); getEventTargetComponent(wrapper, listenerName, eventTargets).simulate(eventName); - expect(handler).toBeCalledTimes(1); + expect(handler).toHaveBeenCalledTimes(1); }); }); } @@ -583,7 +583,7 @@ export function isConformant( const element = getComponent(wrapper); expect(typeof element.type()).toBe('string'); - expect(rootRef).toBeCalledWith(expect.objectContaining({ tagName: _.upperCase(element.type()) })); + expect(rootRef).toHaveBeenCalledWith(expect.objectContaining({ tagName: _.upperCase(element.type()) })); }); } }); diff --git a/packages/fluentui/react-northstar/test/specs/components/Accordion/Accordion-test.tsx b/packages/fluentui/react-northstar/test/specs/components/Accordion/Accordion-test.tsx index 4f10f8f2623e77..b27fecd8af0207 100644 --- a/packages/fluentui/react-northstar/test/specs/components/Accordion/Accordion-test.tsx +++ b/packages/fluentui/react-northstar/test/specs/components/Accordion/Accordion-test.tsx @@ -235,7 +235,7 @@ describe('Accordion', () => { const wrapper = mountWithProvider(); getTitleButtonAtIndex(wrapper, 0).simulate('click'); - expect(onTitleClick).toBeCalledTimes(1); + expect(onTitleClick).toHaveBeenCalledTimes(1); }); it('renders just active panels', () => { diff --git a/packages/fluentui/react-northstar/test/specs/components/Animation/Animation-test.tsx b/packages/fluentui/react-northstar/test/specs/components/Animation/Animation-test.tsx index b10c17a44c666e..f7001f842de745 100644 --- a/packages/fluentui/react-northstar/test/specs/components/Animation/Animation-test.tsx +++ b/packages/fluentui/react-northstar/test/specs/components/Animation/Animation-test.tsx @@ -16,10 +16,10 @@ describe('Animation', () => { }); test('does not throw if children is not passed', () => { - expect(() => mountWithProvider()).not.toThrowError(); + expect(() => mountWithProvider()).not.toThrow(); }); test('does not throw if children function returns undefined', () => { - expect(() => mountWithProvider( undefined} />)).not.toThrowError(); + expect(() => mountWithProvider( undefined} />)).not.toThrow(); }); }); diff --git a/packages/fluentui/react-northstar/test/specs/components/Attachment/Attachment-test.tsx b/packages/fluentui/react-northstar/test/specs/components/Attachment/Attachment-test.tsx index 0a6c2e0583066a..cb21faedc1e48a 100644 --- a/packages/fluentui/react-northstar/test/specs/components/Attachment/Attachment-test.tsx +++ b/packages/fluentui/react-northstar/test/specs/components/Attachment/Attachment-test.tsx @@ -53,7 +53,7 @@ describe('Attachment', () => { findIntrinsicElement(attachment, `.${attachmentActionClassName}`).simulate('keydown', { keyCode: keyboardKey.Enter, }); - expect(onClickAttachment).not.toBeCalled(); + expect(onClickAttachment).not.toHaveBeenCalled(); }); }); }); diff --git a/packages/fluentui/react-northstar/test/specs/components/Dropdown/Dropdown-test.tsx b/packages/fluentui/react-northstar/test/specs/components/Dropdown/Dropdown-test.tsx index ae10f8e33732db..fb991c01e721c2 100644 --- a/packages/fluentui/react-northstar/test/specs/components/Dropdown/Dropdown-test.tsx +++ b/packages/fluentui/react-northstar/test/specs/components/Dropdown/Dropdown-test.tsx @@ -63,7 +63,7 @@ describe('Dropdown', () => { clickOnClearIndicator(); - expect(onChange).toBeCalledTimes(1); + expect(onChange).toHaveBeenCalledTimes(1); expect(onChange).toHaveBeenCalledWith( expect.objectContaining({ type: 'click' }), expect.objectContaining({ @@ -164,7 +164,7 @@ describe('Dropdown', () => { clickOnTriggerButton(); - expect(onOpenChange).toBeCalledTimes(1); + expect(onOpenChange).toHaveBeenCalledTimes(1); expect(onOpenChange).toHaveBeenLastCalledWith( null, expect.objectContaining({ @@ -174,7 +174,7 @@ describe('Dropdown', () => { clickOnTriggerButton(); - expect(onOpenChange).toBeCalledTimes(2); + expect(onOpenChange).toHaveBeenCalledTimes(2); expect(onOpenChange).toHaveBeenLastCalledWith( null, expect.objectContaining({ @@ -1755,7 +1755,7 @@ describe('Dropdown', () => { keyDownOnItemsList('Tab', { preventDefault }); - expect(preventDefault).toBeCalled(); + expect(preventDefault).toHaveBeenCalled(); }); it('keeps focus on input when not passed', () => { @@ -1767,7 +1767,7 @@ describe('Dropdown', () => { }); keyDownOnSearchInput('Tab', { preventDefault }); - expect(preventDefault).toBeCalled(); + expect(preventDefault).toHaveBeenCalled(); }); it('allows focus to move to next item from search input when passed', () => { @@ -1781,7 +1781,7 @@ describe('Dropdown', () => { keyDownOnSearchInput('Tab', { preventDefault }); - expect(preventDefault).not.toBeCalled(); + expect(preventDefault).not.toHaveBeenCalled(); }); it('allows focus to move to next item from items list when passed', () => { @@ -1794,7 +1794,7 @@ describe('Dropdown', () => { keyDownOnItemsList('Tab', { preventDefault }); - expect(preventDefault).not.toBeCalled(); + expect(preventDefault).not.toHaveBeenCalled(); }); }); @@ -1893,14 +1893,14 @@ describe('Dropdown', () => { clickOnItemAtIndex(0, mockedEvent); - expect(onClick).toBeCalledTimes(1); + expect(onClick).toHaveBeenCalledTimes(1); expect(onClick).toHaveBeenCalledWith( expect.objectContaining(mockedEvent), expect.objectContaining({ header: 'Venom', }), ); - expect(stopPropagation).toBeCalledTimes(1); + expect(stopPropagation).toHaveBeenCalledTimes(1); }); it('when selected have onClick called when passed stop event from being propagated', () => { @@ -1917,14 +1917,14 @@ describe('Dropdown', () => { clickOnSelectedItemAtIndex(0, mockedEvent); - expect(onClick).toBeCalledTimes(1); + expect(onClick).toHaveBeenCalledTimes(1); expect(onClick).toHaveBeenCalledWith( expect.objectContaining(mockedEvent), expect.objectContaining({ header: 'Venom', }), ); - expect(stopPropagation).toBeCalledTimes(1); + expect(stopPropagation).toHaveBeenCalledTimes(1); }); }); @@ -1935,7 +1935,7 @@ describe('Dropdown', () => { renderDropdown({ renderSelectedItem, multiple: true, value }); - expect(renderSelectedItem).toBeCalledTimes(value.length); + expect(renderSelectedItem).toHaveBeenCalledTimes(value.length); }); }); diff --git a/packages/fluentui/react-northstar/test/specs/components/Input/Input-test.tsx b/packages/fluentui/react-northstar/test/specs/components/Input/Input-test.tsx index d76012b698cd3a..983e9d272be47b 100644 --- a/packages/fluentui/react-northstar/test/specs/components/Input/Input-test.tsx +++ b/packages/fluentui/react-northstar/test/specs/components/Input/Input-test.tsx @@ -63,7 +63,7 @@ describe('Input', () => { const onChange = jest.fn(); const wrapper = mount(); wrapper.find(`.${inputSlotClassNames.icon}`).first().simulate('click'); - expect(onChange).toBeCalledTimes(1); + expect(onChange).toHaveBeenCalledTimes(1); expect(onChange).toHaveBeenCalledWith( expect.objectContaining({ type: 'click' }), expect.objectContaining({ value: '' }), @@ -81,7 +81,7 @@ describe('Input', () => { stopPropagation, nativeEvent: { stopPropagation: nativeEventStopPropagation }, }); - expect(onChange).toBeCalledTimes(1); + expect(onChange).toHaveBeenCalledTimes(1); expect(onChange).toHaveBeenCalledWith( expect.objectContaining({ type: 'keydown' }), expect.objectContaining({ value: '' }), @@ -100,9 +100,9 @@ describe('Input', () => { stopPropagation, nativeEvent: { stopPropagation: nativeEventStopPropagation }, }); - expect(onChange).not.toBeCalled(); - expect(stopPropagation).not.toBeCalled(); - expect(nativeEventStopPropagation).not.toBeCalled(); + expect(onChange).not.toHaveBeenCalled(); + expect(stopPropagation).not.toHaveBeenCalled(); + expect(nativeEventStopPropagation).not.toHaveBeenCalled(); }); }); describe('icon', () => { diff --git a/packages/fluentui/react-northstar/test/specs/components/Provider/Provider-test.tsx b/packages/fluentui/react-northstar/test/specs/components/Provider/Provider-test.tsx index 7e224643a39884..9a05707dd22bc7 100644 --- a/packages/fluentui/react-northstar/test/specs/components/Provider/Provider-test.tsx +++ b/packages/fluentui/react-northstar/test/specs/components/Provider/Provider-test.tsx @@ -74,7 +74,7 @@ describe('Provider', () => { , ); - expect(getContext).toBeCalledWith( + expect(getContext).toHaveBeenCalledWith( expect.objectContaining({ theme: expect.objectContaining({ siteVariables: { @@ -101,7 +101,7 @@ describe('Provider', () => { , ); - expect(getContext).toBeCalledWith( + expect(getContext).toHaveBeenCalledWith( expect.objectContaining({ theme: expect.objectContaining({ siteVariables: { diff --git a/packages/fluentui/react-northstar/test/specs/components/TextArea/TextArea-test.tsx b/packages/fluentui/react-northstar/test/specs/components/TextArea/TextArea-test.tsx index 769cbae195a8d0..834b3f766d0256 100644 --- a/packages/fluentui/react-northstar/test/specs/components/TextArea/TextArea-test.tsx +++ b/packages/fluentui/react-northstar/test/specs/components/TextArea/TextArea-test.tsx @@ -23,8 +23,11 @@ describe('TextArea', () => { const wrapper = mount(