Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .nx/version-plans/version-plan-1787153597967.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
gamut-styles: minor
variance: minor
gamut: minor
---

Bumps Jest from 29.6.4 → 30.x across the gamut monorepo, refreshes the testing-library family to match, and removes some dead jest-related deps.
16 changes: 7 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,13 @@
"@svgr/cli": "5.5.0",
"@swc-node/register": "^1.11.1",
"@swc/core": "^1.15.18",
"@testing-library/dom": "^8.11.1",
"@testing-library/jest-dom": "^5.16.1",
"@testing-library/dom": "^10.4.1",
"@testing-library/jest-dom": "^7.0.1",
"@testing-library/react": "15.0.6",
"@testing-library/react-hooks": "^7.0.2",
"@testing-library/user-event": "^14.5.2",
"@types/classnames": "2.2.10",
"@types/invariant": "2.2.29",
"@types/jest": "^30.0.0",
"@types/konami-code-js": "^0.8.0",
"@types/lodash": "4.17.23",
"@types/react": "18.3.27",
Expand All @@ -58,7 +58,7 @@
"@types/stylis": "^4.2.0",
"@typescript-eslint/eslint-plugin": "^5.15.0",
"@typescript-eslint/parser": "^5.15.0",
"babel-jest": "29.6.4",
"babel-jest": "30.4.1",
"babel-plugin-macros": "3.0.1",
"commander": "^14.0.3",
"component-test-setup": "^0.3.1",
Expand All @@ -71,12 +71,10 @@
"http-server": "^14.1.1",
"husky": "^9.1.7",
"identity-obj-proxy": "3.0.0",
"jest": "29.6.4",
"jest-environment-jsdom": "29.6.4",
"jest-environment-jsdom-global": "4.0.0",
"jest": "30.4.2",
"jest-environment-jsdom": "30.4.1",
"jest-junit": "^16.0.0",
"lint-staged": "^16.4.0",
"mutationobserver-shim": "^0.3.3",
"nx": "22.6.0",
"nx-cloud": "19.1.0",
"onchange": "^7.0.2",
Expand All @@ -89,7 +87,7 @@
"style-loader": "^4.0.0",
"svgo": "^1.3.2",
"syncpack": "^10.9.3",
"ts-jest": "29.1.1",
"ts-jest": "^29.4.12",
"ts-node": "10.9.1",
"tslib": "2.4.0",
"typescript": "5.9.3"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing

exports[`themes admin - theme shape 1`] = `
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing

exports[`Gamut Exported Keys 1`] = `
[
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ describe('ConnectedForm - useDebouncedField', () => {
input.blur();
// Now it has finally been called to update the data
expect(mockedSetValue).toHaveBeenCalledTimes(1);
expect(mockedSetValue).lastCalledWith(mockInputKey, 'tifa', {
expect(mockedSetValue).toHaveBeenLastCalledWith(mockInputKey, 'tifa', {
shouldDirty: true,
});
});
Expand All @@ -162,7 +162,7 @@ describe('ConnectedForm - useDebouncedField', () => {

input.blur();
expect(mockedSetValue).toHaveBeenCalledTimes(1);
expect(mockedSetValue).lastCalledWith(mockInputKey, 'tifa', {
expect(mockedSetValue).toHaveBeenLastCalledWith(mockInputKey, 'tifa', {
shouldDirty: true,
});
});
Expand Down Expand Up @@ -194,12 +194,14 @@ describe('ConnectedForm - useDebouncedField', () => {
});
// Form has been dirtied by changing input
expect(mockedSetValue).toHaveBeenCalledTimes(1);
expect(mockedSetValue).lastCalledWith('', '', { shouldDirty: true });
expect(mockedSetValue).toHaveBeenLastCalledWith('', '', {
shouldDirty: true,
});

input.blur();
// Now it has finally been called to update the data
expect(mockedSetValue).toHaveBeenCalledTimes(2);
expect(mockedSetValue).lastCalledWith(mockInputKey, 'tifa', {
expect(mockedSetValue).toHaveBeenLastCalledWith(mockInputKey, 'tifa', {
shouldDirty: false,
});

Expand All @@ -213,7 +215,9 @@ describe('ConnectedForm - useDebouncedField', () => {
});
// Form has been dirtied by changing input
expect(mockedSetValue).toHaveBeenCalledTimes(3);
expect(mockedSetValue).lastCalledWith('', '', { shouldDirty: true });
expect(mockedSetValue).toHaveBeenLastCalledWith('', '', {
shouldDirty: true,
});
});

it('can handle non-string values (aka a checkbox)', async () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,6 @@ describe('Disclosure', () => {
await act(async () => {
await userEvent.click(CTAButton);
});
expect(ctaCallback).toBeCalled();
expect(ctaCallback).toHaveBeenCalled();
});
});
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing

exports[`parseSelectOptions creates an option list 1`] = `
[
Expand Down
2 changes: 1 addition & 1 deletion packages/gamut/src/GridForm/__tests__/GridForm.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -473,7 +473,7 @@ describe('GridForm', () => {

expect(cancelButton);
expect(buttons.length).toEqual(2);
expect(cancelOnClick).toBeCalled();
expect(cancelOnClick).toHaveBeenCalled();
});

it('renders only a submit when "cancel" props are not provided', () => {
Expand Down
9 changes: 9 additions & 0 deletions packages/gamut/src/Modals/__tests__/Modal.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -369,6 +369,15 @@ describe('Modal', () => {
children: 'Cancel',
},
},
{
title: 'Multi view',
children: <>View 2</>,
primaryCta: { actionType: 'confirm', children: 'Done' },
secondaryCta: {
actionType: 'cancel',
children: 'Cancel',
},
},
Comment on lines +372 to +380

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this seems out of place, why did this need to change?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh! it was a real test failure where the next button was disabled bc it was testing multiview with only one view. selling the jest bump with this one example!

],
});

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing

exports[`title.macro should transform a js file 1`] = `
"export const meta = {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing

exports[`style props parsers media query styles Equivalent Syntax SM and MD - [ <2 empty items>, 16, 0, [length]: 4 ] === { sm: 16, md: 0 } 1`] = `
{
Expand Down
2 changes: 0 additions & 2 deletions script/jest/base-setup.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,3 @@ Date.now = jest.fn(() => new Date(2011, 6, 1).valueOf());
function noop() {}

Object.defineProperty(window, 'scrollTo', { value: noop, writable: true });

require('mutationobserver-shim');
Loading
Loading