Skip to content

Commit 59b0313

Browse files
Update build node version and bump NextJS version in test app (#4486)
* pin pkgr/utils for now a sub dep of eslint-config-next pulls in a execa version that isnt compatible with our node version in circleci. Until we upgrade the node version and fix the numberfield tests, this fixes the build * update nextjs version and node version on circleci also fixes tests to match browser behavior * fix tests * fix new batch of failing tests --------- Co-authored-by: Robert Snow <[email protected]>
1 parent b87b7c4 commit 59b0313

File tree

5 files changed

+18
-16
lines changed

5 files changed

+18
-16
lines changed

.circleci/config.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,22 +6,22 @@ orbs:
66
executors:
77
rsp:
88
docker:
9-
- image: cimg/node:16.13.2
9+
- image: cimg/node:16.20.0
1010
environment:
1111
CACHE_VERSION: v1
1212
working_directory: ~/react-spectrum
1313

1414
rsp-large:
1515
docker:
16-
- image: cimg/node:16.13.2
16+
- image: cimg/node:16.20.0
1717
resource_class: large
1818
environment:
1919
CACHE_VERSION: v1
2020
working_directory: ~/react-spectrum
2121

2222
rsp-xlarge:
2323
docker:
24-
- image: cimg/node:16.13.2
24+
- image: cimg/node:16.20.0
2525
resource_class: xlarge
2626
environment:
2727
CACHE_VERSION: v1

examples/rsp-next-ts/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,15 @@
1717
"@react-spectrum/toast": "^3.0.0-alpha.0",
1818
"@spectrum-icons/illustrations": "^3.5.0",
1919
"@spectrum-icons/workflow": "^4.0.3",
20-
"next": "13.2.4",
20+
"next": "^13.4.1",
2121
"react": "^18.2.0",
2222
"react-dom": "^18.2.0"
2323
},
2424
"devDependencies": {
2525
"@types/node": "^18.8.2",
2626
"@types/react": "^18.0.21",
2727
"eslint": "^8.24.0",
28-
"eslint-config-next": "13.2.4",
28+
"eslint-config-next": "^13.4.1",
2929
"typescript": "^4.8.4"
3030
}
3131
}

packages/@react-spectrum/datepicker/test/DateRangePicker.test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1020,7 +1020,7 @@ describe('DateRangePicker', function () {
10201020
expect(endField).not.toHaveAttribute('aria-describedby');
10211021

10221022
let description = group.getAttribute('aria-describedby').split(' ').map(d => document.getElementById(d).textContent).join(' ');
1023-
expect(description).toBe('Selected Range: February 3, 2020, 8:00 AM to February 10, 2020, 10:00 AM');
1023+
expect(description).toBe('Selected Range: February 3, 2020 at 8:00 AM to February 10, 2020 at 10:00 AM');
10241024
});
10251025

10261026
it('should handle selected range description when start and end dates are the same', function () {
@@ -1034,7 +1034,7 @@ describe('DateRangePicker', function () {
10341034
expect(endField).not.toHaveAttribute('aria-describedby');
10351035

10361036
let description = group.getAttribute('aria-describedby').split(' ').map(d => document.getElementById(d).textContent).join(' ');
1037-
expect(description).toBe('Selected Range: February 3, 2020, 8:00 AM to February 3, 2020, 8:00 AM');
1037+
expect(description).toBe('Selected Range: February 3, 2020 at 8:00 AM to February 3, 2020 at 8:00 AM');
10381038
});
10391039

10401040
it('should support format help text', function () {

packages/@react-spectrum/labeledvalue/test/LabeledValue.test.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,7 @@ describe('LabeledValue', function () {
107107
let staticField = getByTestId('test-id');
108108
expect(staticField).toBeInTheDocument();
109109
expect(staticField).toHaveTextContent('Feb 3, 2020, 12:23:24 PM');
110+
110111
});
111112

112113
it('renders correctly with ZonedDateTime value', function () {
@@ -119,7 +120,8 @@ describe('LabeledValue', function () {
119120

120121
let staticField = getByTestId('test-id');
121122
expect(staticField).toBeInTheDocument();
122-
expect(staticField).toHaveTextContent('February 3, 2020, 12:00 AM PST');
123+
expect(staticField).toHaveTextContent('February 3, 2020 at 12:00 AM PST');
124+
123125
});
124126

125127
it('renders correctly with ZonedDateTime value with user provided format options', function () {
@@ -190,7 +192,7 @@ describe('LabeledValue', function () {
190192

191193
let staticField = getByTestId('test-id');
192194
expect(staticField).toBeInTheDocument();
193-
expect(staticField).toHaveTextContent('July 5, 2019, 12:00 AM – July 10, 2019, 12:00 AM');
195+
expect(staticField).toHaveTextContent('July 5, 2019 at 12:00 AM – July 10, 2019 at 12:00 AM');
194196
});
195197

196198
it('renders correctly with RangeValue<Time>', function () {
@@ -217,7 +219,7 @@ describe('LabeledValue', function () {
217219

218220
let staticField = getByTestId('test-id');
219221
expect(staticField).toBeInTheDocument();
220-
expect(staticField).toHaveTextContent('February 3, 2020, 12:00 AM PST – March 3, 2020, 12:00 AM PST');
222+
expect(staticField).toHaveTextContent('February 3, 2020 at 12:00 AM PST – March 3, 2020 at 12:00 AM PST');
221223
});
222224

223225
it('renders correctly with RangeValue<CalendarDateTime>', function () {
@@ -230,7 +232,7 @@ describe('LabeledValue', function () {
230232

231233
let staticField = getByTestId('test-id');
232234
expect(staticField).toBeInTheDocument();
233-
expect(staticField).toHaveTextContent('February 3, 2020, 12:23 PM – March 3, 2020, 12:23 PM');
235+
expect(staticField).toHaveTextContent('February 3, 2020 at 12:23 PM – March 3, 2020 at 12:23 PM');
234236
});
235237

236238
it('renders correctly with RangeValue<CalendarDate>', function () {

packages/@react-spectrum/numberfield/test/NumberField.test.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -927,7 +927,7 @@ describe('NumberField', function () {
927927
userEvent.type(textField, '(10)');
928928
expect(textField).toHaveAttribute('value', '(10)');
929929
expect(announce).toHaveBeenCalledTimes(3);
930-
expect(announce).toHaveBeenLastCalledWith('؜−١٠٫٠٠ US$', 'assertive');
930+
expect(announce).toHaveBeenLastCalledWith('‎−US$ 10.00', 'assertive');
931931
act(() => {textField.blur();});
932932
expect(textField).toHaveAttribute('value', '(US$10.00)');
933933
expect(onChangeSpy).toHaveBeenCalledTimes(1);
@@ -979,7 +979,7 @@ describe('NumberField', function () {
979979
it.each`
980980
Name | props | locale | expected
981981
${'US Euros'} | ${{formatOptions: {style: 'currency', currency: 'EUR'}}} | ${'en-US'} | ${'€10.00'}
982-
${'Arabic Euros'} | ${{formatOptions: {style: 'currency', currency: 'EUR'}}} | ${'ar-AE'} | ${'١٠٫٠٠ €'}
982+
${'Arabic Euros'} | ${{formatOptions: {style: 'currency', currency: 'EUR'}}} | ${'ar-AE'} | ${'€ 10.00'}
983983
${'French Euros'} | ${{formatOptions: {style: 'currency', currency: 'EUR'}}} | ${'fr-FR'} | ${'10,00 €'}
984984
${'US JPY'} | ${{formatOptions: {style: 'currency', currency: 'JPY'}}} | ${'en-US'} | ${'¥10'}
985985
`('$Name keeps formatted value on focus', ({props, locale, expected}) => {
@@ -996,10 +996,10 @@ describe('NumberField', function () {
996996
Name | props | locale | expected
997997
${'US Euros'} | ${{defaultValue: 10, formatOptions: {style: 'currency', currency: 'EUR'}}} | ${'en-US'} | ${['€10.00', '€11.00', '€9.00']}
998998
${'French Euros'} | ${{defaultValue: 10, formatOptions: {style: 'currency', currency: 'EUR'}}} | ${'fr-FR'} | ${['10,00 €', '11,00 €', '9,00 €']}
999-
${'Arabic Euros'} | ${{defaultValue: 10, formatOptions: {style: 'currency', currency: 'EUR'}}} | ${'ar-AE'} | ${['١٠٫٠٠ €', '١١٫٠٠ €', '٩٫٠٠ €']}
999+
${'Arabic Euros'} | ${{defaultValue: 10, formatOptions: {style: 'currency', currency: 'EUR'}}} | ${'ar-AE'} | ${['€ 10.00', '€ 11.00', '€ 9.00']}
10001000
${'US Euros negative'} | ${{defaultValue: -10, formatOptions: {style: 'currency', currency: 'EUR'}}} | ${'en-US'} | ${['-€10.00', '-€9.00', '-€11.00']}
10011001
${'French Euros negative'} | ${{defaultValue: -10, formatOptions: {style: 'currency', currency: 'EUR'}}} | ${'fr-FR'} | ${['-10,00 €', '-9,00 €', '-11,00 €']}
1002-
${'Arabic Euros negative'} | ${{defaultValue: -10, formatOptions: {style: 'currency', currency: 'EUR'}}} | ${'ar-AE'} | ${['\u061C-\u0661\u0660\u066B\u0660\u0660\xA0\u20AC', '\u061C-\u0669\u066B\u0660\u0660\xA0\u20AC', '\u061C-\u0661\u0661\u066B\u0660\u0660\xA0\u20AC']}
1002+
${'Arabic Euros negative'} | ${{defaultValue: -10, formatOptions: {style: 'currency', currency: 'EUR'}}} | ${'ar-AE'} | ${['‎-€ 10.00', '‎-€ 9.00', '‎-€ 11.00']}
10031003
`('$Name pressing increment & decrement keeps formatting', ({props, locale, expected}) => {
10041004
let {textField, incrementButton, decrementButton} = renderNumberField({minValue: -15, ...props}, {locale});
10051005

@@ -1015,7 +1015,7 @@ describe('NumberField', function () {
10151015
Name | props | locale | expected
10161016
${'US Euros'} | ${{formatOptions: {style: 'currency', currency: 'EUR'}}} | ${'en-US'} | ${['€10.00', '€11.00', '€9.00', '€9.00']}
10171017
${'French Euros'} | ${{formatOptions: {style: 'currency', currency: 'EUR'}}} | ${'fr-FR'} | ${['10,00 €', '11,00 €', '9,00 €', '9,00 €']}
1018-
${'Arabic Euros'} | ${{formatOptions: {style: 'currency', currency: 'EUR'}}} | ${'ar-AE'} | ${['١٠٫٠٠ €', '١١٫٠٠ €', '٩٫٠٠ €', '٩٫٠٠ €']}
1018+
${'Arabic Euros'} | ${{formatOptions: {style: 'currency', currency: 'EUR'}}} | ${'ar-AE'} | ${['€ 10.00', '€ 11.00', '€ 9.00', '€ 9.00']}
10191019
`('$Name pressing up arrow & down arrow keeps focus state formatting', ({props, locale, expected}) => {
10201020
let {textField} = renderNumberField({defaultValue: 10, onKeyDown: onKeyDownSpy, onKeyUp: onKeyUpSpy, ...props}, {locale});
10211021

0 commit comments

Comments
 (0)