Files
2026-09-10 18:14:05 +01:00

60 lines
2.4 KiB
TypeScript

import { expect, test } from "../../fixtures/test-base";
import { expectControlHeight, expectControlWidth } from "../../helpers/control-sizing";
import { LayoutSettingsPage } from "../../pages/layout-settings-page";
test.describe("Settings control sizing", () => {
test("uses the standard desktop height for layout actions", async ({ testPage }) => {
await testPage.setViewportSize({ width: 1280, height: 900 });
const layouts = new LayoutSettingsPage(testPage);
await layouts.open();
await expectControlHeight(testPage.getByTestId("layout-profile-create"), 28);
await expectControlHeight(testPage.getByTestId("layout-profile-duplicate"), 28);
});
test("keeps repository secret fields at the standard desktop height", async ({
testPage,
apiClient,
seedData,
}) => {
const secret = await apiClient.createSecret(
"Control sizing repository secret",
"control-sizing-value",
);
await apiClient.updateRepository(seedData.repositoryId, {
secret_bindings: [{ key: "CONTROL_SIZING_TOKEN", secret_id: secret.id }],
});
try {
await testPage.setViewportSize({ width: 1280, height: 900 });
await testPage.goto(`/settings/workspace/${seedData.workspaceId}/repositories`);
await testPage.getByRole("heading", { name: "E2E Repo", exact: true }).click();
const editor = testPage.getByTestId("repository-secret-bindings");
await expectControlHeight(editor.getByTestId("repository-secret-key-0"), 28);
await expectControlHeight(editor.getByTestId("repository-secret-select-0"), 28);
} finally {
await apiClient.updateRepository(seedData.repositoryId, { secret_bindings: [] });
await apiClient.deleteSecretIfPresent(secret.id);
}
});
test("keeps the executor profile delete action square on desktop", async ({
testPage,
apiClient,
seedData,
}) => {
await testPage.setViewportSize({ width: 1280, height: 900 });
const { executors } = await apiClient.listExecutors();
const executor = executors.find((candidate) =>
candidate.profiles?.some((profile) => profile.id === seedData.worktreeExecutorProfileId),
);
expect(executor).toBeDefined();
await testPage.goto(`/settings/executor/${executor!.id}`);
const deleteButton = testPage.getByTestId("executor-profile-delete-button");
await expectControlHeight(deleteButton, 28);
await expectControlWidth(deleteButton, 28);
});
});