test(work-orders): remove query devtools overlay after navigation

Also drops ticket keys from shipped comments and test names.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Codex Review Integration 2026-09-16 15:15:52 -03:00
parent 050e3f5134
commit 4eb929e1c8
3 changed files with 16 additions and 6 deletions

View file

@ -16,6 +16,18 @@ async function fulfillJson(route: Route, body: unknown, status = 200) {
await route.fulfill({ status, contentType: "application/json", body: JSON.stringify(body) });
}
async function hideQueryDevtools(page: Page) {
await page.addStyleTag({
content:
".tsqd-parent-container { display: none !important; pointer-events: none !important; }",
});
await page.locator(".tsqd-parent-container").evaluateAll((nodes) => {
for (const node of nodes) {
node.remove();
}
});
}
const REAL_ROW = {
id: 1000,
woNumber: "12345678901",
@ -58,7 +70,7 @@ async function mockBoard(page: Page, patches: unknown[]) {
);
}
test.describe("inline WO number SH placeholder (SH-320)", () => {
test.describe("inline WO number SH placeholder", () => {
test.setTimeout(60_000);
test.beforeEach(async ({ page }) => {
@ -66,9 +78,6 @@ test.describe("inline WO number SH placeholder (SH-320)", () => {
await page.clock.resume();
await page.addInitScript((user) => {
localStorage.setItem("auth", JSON.stringify(user));
const style = document.createElement("style");
style.textContent = ".tsqd-parent-container { display: none !important; }";
document.documentElement.appendChild(style);
}, TEST_USER);
});
@ -78,6 +87,7 @@ test.describe("inline WO number SH placeholder (SH-320)", () => {
const mutations: unknown[] = [];
await mockBoard(page, mutations);
await page.goto("/workorders");
await hideQueryDevtools(page);
await expect(page.getByRole("heading", { name: "Work Orders" })).toBeVisible({
timeout: 20_000,
});

View file

@ -25,7 +25,7 @@ export function isValidBoardWoNumber(woNumber: string): boolean {
}
/**
* SH-320: only an already-saved real APM number is protected from being replaced by an
* Only an already-saved real APM number is protected from being replaced by an
* SH placeholder. A brand-new WO has no saved number, so the rule never applies there.
*/
export function isWoNumberDowngrade(savedWoNumber: string, nextWoNumber: string): boolean {

View file

@ -35,7 +35,7 @@ function typeAndCommit(nextValue: string) {
fireEvent.keyDown(input, { key: "Enter" });
}
describe("EditableWONumberCell SH placeholder numbers (SH-320)", () => {
describe("EditableWONumberCell SH placeholder numbers", () => {
beforeEach(() => {
vi.mocked(workOrdersApi.findByWoNumber).mockResolvedValue(null as never);
vi.mocked(toast).mockClear();