-
Notifications
You must be signed in to change notification settings - Fork 5.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- Loading branch information
1 parent
1189572
commit 83ccb74
Showing
3 changed files
with
23 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import { describe, it, expect } from "vitest"; | ||
import store from "../src/store"; | ||
import { setInitialQuery, clearInitialQuery } from "../src/state/initial-query-slice"; | ||
|
||
describe("Initial Query Behavior", () => { | ||
it("should clear initial query when clearInitialQuery is dispatched", () => { | ||
// Set up initial query in the store | ||
store.dispatch(setInitialQuery("test query")); | ||
expect(store.getState().initalQuery.initialQuery).toBe("test query"); | ||
|
||
// Clear the initial query | ||
store.dispatch(clearInitialQuery()); | ||
|
||
// Verify initial query is cleared | ||
expect(store.getState().initalQuery.initialQuery).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