forked from mui/mui-x
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[pickers] Always use the same timezone in the field, the view and the…
… layout components (mui#13481)
- Loading branch information
1 parent
f3d3317
commit 55104d1
Showing
3 changed files
with
59 additions
and
29 deletions.
There are no files selected for viewing
25 changes: 25 additions & 0 deletions
25
packages/x-date-pickers/src/MobileTimePicker/tests/timezone.MobileTimePicker.test.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import * as React from 'react'; | ||
import { screen } from '@mui/internal-test-utils'; | ||
import { describeAdapters } from 'test/utils/pickers'; | ||
import { MobileTimePicker } from '@mui/x-date-pickers/MobileTimePicker'; | ||
import { expect } from 'chai'; | ||
|
||
describe('<MobileTimePicker /> - Timezone', () => { | ||
describeAdapters('Timezone prop', MobileTimePicker, ({ adapter, render }) => { | ||
if (!adapter.isTimezoneCompatible) { | ||
return; | ||
} | ||
|
||
it('should use the timezone prop for the value displayed in the toolbar', () => { | ||
render( | ||
<MobileTimePicker | ||
timezone="America/New_York" | ||
value={adapter.date('2022-04-17T15:30', 'default')} | ||
open | ||
/>, | ||
); | ||
|
||
expect(screen.getByMuiTest('hours')).to.have.text('11'); | ||
}); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters