33 lines · 1.1 KB · TypeScript
RawDownload
import { QueryClient } from "@tanstack/react-query";import { describe, expect, it } from "vitest";import {  gitMutationKeys,  gitPullMutationOptions,  gitRunStackedActionMutationOptions,} from "./gitReactQuery"; describe("gitMutationKeys", () => {  it("scopes stacked action keys by cwd", () => {    expect(gitMutationKeys.runStackedAction("/repo/a")).not.toEqual(      gitMutationKeys.runStackedAction("/repo/b"),    );  });   it("scopes pull keys by cwd", () => {    expect(gitMutationKeys.pull("/repo/a")).not.toEqual(gitMutationKeys.pull("/repo/b"));  });}); describe("git mutation options", () => {  const queryClient = new QueryClient();   it("attaches cwd-scoped mutation key for runStackedAction", () => {    const options = gitRunStackedActionMutationOptions({ cwd: "/repo/a", queryClient });    expect(options.mutationKey).toEqual(gitMutationKeys.runStackedAction("/repo/a"));  });   it("attaches cwd-scoped mutation key for pull", () => {    const options = gitPullMutationOptions({ cwd: "/repo/a", queryClient });    expect(options.mutationKey).toEqual(gitMutationKeys.pull("/repo/a"));  });});

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t