-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' into feature/campaign-feedback
- Loading branch information
Showing
10 changed files
with
139 additions
and
27 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
4 changes: 3 additions & 1 deletion
4
packages/ripple-tide-search/components/TideSearchSortOptions.vue
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
63 changes: 63 additions & 0 deletions
63
packages/ripple-ui-forms/src/components/RplFormDropdown/RplFormDropdown.cy.ts
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,63 @@ | ||
import RplFormDropDown from './RplFormDropdown.vue' | ||
import { RplFormDropdownOptions } from './fixtures/sample' | ||
|
||
const props = { | ||
id: 'dropdown', | ||
labelId: 'dropdown', | ||
placeholder: 'Select', | ||
options: RplFormDropdownOptions | ||
} | ||
|
||
describe('RplFormDropDown', () => { | ||
it('mounts', () => { | ||
cy.mount(RplFormDropDown, { props }) | ||
|
||
cy.get('.rpl-form-dropdown').should('be.visible') | ||
}) | ||
|
||
it('can be toggled open and closed', () => { | ||
cy.mount(RplFormDropDown, { props }) | ||
|
||
cy.get('.rpl-form-dropdown-input').click() | ||
cy.get('.rpl-form-dropdown-menu').should('be.visible') | ||
cy.get('.rpl-form-dropdown-input').click() | ||
cy.get('.rpl-form-dropdown-menu').should('not.exist') | ||
}) | ||
|
||
it('can be "searched" by typing from the input', () => { | ||
cy.mount(RplFormDropDown, { props }) | ||
|
||
cy.get('.rpl-form-dropdown-input').type('b') | ||
cy.focused().contains('Banana') | ||
|
||
cy.get('.rpl-form-dropdown-input').type('bl') | ||
cy.focused().contains('Blueberries') | ||
}) | ||
|
||
it('can be "searched" by typing from an option', () => { | ||
cy.mount(RplFormDropDown, { props }) | ||
|
||
cy.get('.rpl-form-dropdown-input').click() | ||
cy.get('.rpl-form-dropdown-option').first().type('apr') | ||
cy.focused().contains('Apricots') | ||
|
||
cy.get('.rpl-form-dropdown-option').first().type('l') | ||
cy.focused().contains('Lemon') | ||
}) | ||
|
||
it('can be "traversed" by cycling through a single key stroke', () => { | ||
cy.mount(RplFormDropDown, { props }) | ||
|
||
cy.get('.rpl-form-dropdown-input').type('a') | ||
cy.focused().contains('Apple') | ||
|
||
cy.focused().type('a') | ||
cy.focused().contains('Apricots') | ||
|
||
cy.focused().type('a') | ||
cy.focused().contains('Avocado') | ||
|
||
cy.focused().type('a') | ||
cy.focused().contains('Apple') | ||
}) | ||
}) |
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
15 changes: 15 additions & 0 deletions
15
packages/ripple-ui-forms/src/components/RplFormDropdown/fixtures/sample.ts
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,15 @@ | ||
export const RplFormDropdownOptions = [ | ||
{ id: 'apple', value: 'apple', label: 'Apple' }, | ||
{ id: 'banana', value: 'banana', label: 'Banana' }, | ||
{ id: 'orange', value: 'orange', label: 'Orange' }, | ||
{ id: 'strawberry', value: 'strawberry', label: 'Strawberry' }, | ||
{ id: 'apricots', value: 'apricots', label: 'Apricots' }, | ||
{ id: 'grapes', value: 'grapes', label: 'Grapes' }, | ||
{ id: 'pineapple', value: 'pineapple', label: 'Pineapple' }, | ||
{ id: 'sultana', value: 'sultana', label: 'Sultana' }, | ||
{ id: 'blueberries', value: 'blueberries', label: 'Blueberries' }, | ||
{ id: 'avocado', value: 'avocado', label: 'Avocado' }, | ||
{ id: 'peach', value: 'peach', label: 'Peach' }, | ||
{ id: 'lemon', value: 'lemon', label: 'Lemon' }, | ||
{ id: 'watermelon', value: 'watermelon', label: 'Watermelon' } | ||
] |