-
Notifications
You must be signed in to change notification settings - Fork 98
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(Select): add support mobile view (#579)
- Loading branch information
Vladimir Chernitsyn
authored
Mar 27, 2023
1 parent
8ee1301
commit 0c0df4a
Showing
10 changed files
with
133 additions
and
30 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import {DEFAULT_OPTIONS, setup, TEST_QA} from './utils'; | ||
import userEvent from '@testing-library/user-event'; | ||
import {SelectQa} from '../constants'; | ||
|
||
const onUpdate = jest.fn(); | ||
describe('Select popup', () => { | ||
test.each([ | ||
{ | ||
attribute: SelectQa.SHEET, | ||
mode: 'mobile', | ||
}, | ||
{ | ||
attribute: SelectQa.POPUP, | ||
mode: 'desktop', | ||
}, | ||
])('should render $attribute, when mode is $mode', async ({mode, attribute}) => { | ||
const mobile = mode === 'mobile'; | ||
const {getByTestId, queryByTestId} = setup( | ||
{ | ||
options: DEFAULT_OPTIONS, | ||
onUpdate, | ||
}, | ||
mobile, | ||
); | ||
|
||
const user = userEvent.setup(); | ||
const selectControl = getByTestId(TEST_QA); | ||
// open select popup | ||
await user.click(selectControl); | ||
// looking for popup | ||
const popup = queryByTestId(attribute); | ||
|
||
expect(popup).not.toBeNull(); | ||
}); | ||
}); |
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
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
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
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