mirror of
https://github.com/farion1231/cc-switch.git
synced 2026-10-25 17:22:27 +08:00
fix(ci): stabilize frontend tests and verify renderer build
This commit is contained in:
1 parent
09c5d39d8c
commit
4b1ec8b55b
3 files changed
+14
-7
No files matched your search
@@ -99,6 +99,9 @@ jobs:
|
|||||||
- name: Unit tests
|
- name: Unit tests
|
||||||
run: pnpm test:unit
|
run: pnpm test:unit
|
||||||
|
|
||||||
|
- name: Build frontend
|
||||||
|
run: pnpm build:renderer
|
||||||
|
|
||||||
backend:
|
backend:
|
||||||
name: Backend Checks
|
name: Backend Checks
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
|
|||||||
@@ -1344,22 +1344,25 @@ describe("PiProviderForm", () => {
|
|||||||
|
|
||||||
it("edits Pi thinking-map missing, null, and string states from the collapsed capability area", async () => {
|
it("edits Pi thinking-map missing, null, and string states from the collapsed capability area", async () => {
|
||||||
const user = userEvent.setup();
|
const user = userEvent.setup();
|
||||||
|
// Start with a model so this test exercises thinking-map interactions without
|
||||||
|
// repeating the separately covered preset selection and model creation flow.
|
||||||
render(
|
render(
|
||||||
<PiProviderForm
|
<PiProviderForm
|
||||||
appId="pi"
|
appId="pi"
|
||||||
|
providerId="custom-provider"
|
||||||
submitLabel="Save custom thinking map"
|
submitLabel="Save custom thinking map"
|
||||||
onSubmit={vi.fn()}
|
onSubmit={vi.fn()}
|
||||||
onCancel={() => {}}
|
onCancel={() => {}}
|
||||||
|
initialData={{
|
||||||
|
name: "Custom reasoning provider",
|
||||||
|
settingsConfig: {
|
||||||
|
api: "openai-completions",
|
||||||
|
models: [completeModel("custom-reasoning-model")],
|
||||||
|
},
|
||||||
|
}}
|
||||||
/>,
|
/>,
|
||||||
);
|
);
|
||||||
|
|
||||||
await user.click(
|
|
||||||
screen.getByRole("button", { name: "providerPreset.custom" }),
|
|
||||||
);
|
|
||||||
await user.click(screen.getByRole("button", { name: "pi.form.addModel" }));
|
|
||||||
fireEvent.change(screen.getByLabelText("pi.form.modelId"), {
|
|
||||||
target: { value: "custom-reasoning-model" },
|
|
||||||
});
|
|
||||||
await user.click(
|
await user.click(
|
||||||
screen.getByRole("button", { name: "展开或收起模型详情" }),
|
screen.getByRole("button", { name: "展开或收起模型详情" }),
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ export default defineConfig({
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
test: {
|
test: {
|
||||||
|
include: ["{src,tests}/**/*.{test,spec}.{ts,tsx,js,jsx}"],
|
||||||
environment: "jsdom",
|
environment: "jsdom",
|
||||||
setupFiles: ["./tests/setupGlobals.ts", "./tests/setupTests.ts"],
|
setupFiles: ["./tests/setupGlobals.ts", "./tests/setupTests.ts"],
|
||||||
globals: true,
|
globals: true,
|
||||||
|
|||||||
Reference in new issue
Block a user