-
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.
feat(@dpc-sdp/ripple-ui-core): ✨ add debounce option to search bar
- Loading branch information
1 parent
e26c8ba
commit 2badcc4
Showing
5 changed files
with
54 additions
and
16 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
20 changes: 20 additions & 0 deletions
20
packages/ripple-ui-core/src/components/search-bar/RplSearchBar.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,20 @@ | ||
import RplSearchBar from './RplSearchBar.vue' | ||
import { mockSuggestions } from './fixtures' | ||
|
||
const baseProps = { | ||
suggestions: mockSuggestions, | ||
id: '1234' | ||
} | ||
|
||
describe('RplSearchBar', () => { | ||
it('opens', () => { | ||
cy.mount(RplSearchBar, { | ||
props: { | ||
...baseProps | ||
} | ||
}) | ||
cy.get('#1234__menu').should('not.exist') | ||
cy.get('input#1234').click() | ||
cy.get('#1234__menu').should('exist') | ||
}) | ||
}) |
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
9 changes: 9 additions & 0 deletions
9
packages/ripple-ui-core/src/components/search-bar/fixtures/index.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,9 @@ | ||
export const mockSuggestions = [ | ||
'rip', | ||
'ripe', | ||
'ripen', | ||
'riptide', | ||
'ripple', | ||
'ripple components', | ||
'ripple component' | ||
] |