File size: 661 Bytes
b59aa07
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
import { describe, it, expect } from "vitest";
import store from "../src/store";
import {
  setInitialPrompt,
  clearInitialPrompt,
} from "../src/state/initial-query-slice";

describe("Initial Query Behavior", () => {
  it("should clear initial query when clearInitialPrompt is dispatched", () => {
    // Set up initial query in the store
    store.dispatch(setInitialPrompt("test query"));
    expect(store.getState().initialQuery.initialPrompt).toBe("test query");

    // Clear the initial query
    store.dispatch(clearInitialPrompt());

    // Verify initial query is cleared
    expect(store.getState().initialQuery.initialPrompt).toBeNull();
  });
});