mirror of
https://github.com/cypress-io/cypress.git
synced 2026-03-18 10:22:50 -05:00
fix: restore spec filter in client side store (#24987)
* run ci - bring back specFilter in store * restore test for saved search Co-authored-by: Matt Henkes <mjhenkes@gmail.com>
This commit is contained in:
@@ -245,8 +245,7 @@ describe('App: Spec List (E2E)', () => {
|
||||
cy.findByText('No specs matched your search:').should('not.be.visible')
|
||||
})
|
||||
|
||||
// TODO: FIGURE OUT WHY THIS IS NOW FAILING CONSTANTLY
|
||||
it.skip('saves the filter when navigating to a spec and back', function () {
|
||||
it('saves the filter when navigating to a spec and back', function () {
|
||||
const targetSpecFile = 'accounts_list.spec.js'
|
||||
|
||||
clearSearchAndType(targetSpecFile)
|
||||
|
||||
@@ -25,6 +25,7 @@ export function useSpecFilter (savedFilter?: string) {
|
||||
|
||||
function setSpecFilter (specFilter: string) {
|
||||
if (specStore.specFilter !== specFilter) {
|
||||
specStore.setSpecFilter(specFilter)
|
||||
saveSpecFilter.executeMutation({ value: JSON.stringify({ specFilter }) })
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,6 +12,7 @@ export const useSpecStore = defineStore({
|
||||
state (): SpecState {
|
||||
return {
|
||||
activeSpec: undefined,
|
||||
specFilter: undefined,
|
||||
}
|
||||
},
|
||||
|
||||
@@ -19,5 +20,8 @@ export const useSpecStore = defineStore({
|
||||
setActiveSpec (activeSpec: SpecFile | null) {
|
||||
this.activeSpec = activeSpec
|
||||
},
|
||||
setSpecFilter (filter: string) {
|
||||
this.specFilter = filter
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user