MCPcopy Create free account
hub / github.com/bytebase/bytebase / setJIT

Function setJIT

frontend/tests/e2e/sql-editor/sql-editor-jit.spec.ts:66–82  ·  view source on GitHub ↗
(enabled: boolean)

Source from the content-addressed store, hash-verified

64let adminPage: Page;
65
66async function setJIT(enabled: boolean): Promise<void> {
67 // Also set allowRequestRole=true: the JIT label tests below need a
68 // RequestQueryButton to render at all (the component returns null
69 // when allowRequestRole is false — see RequestQueryButton.tsx:131,
70 // 159-161). The new sample project is born with allowRequestRole=false;
71 // the JIT tests are about the LABEL flipping, not about whether the
72 // button shows up.
73 await env.api.updateProjectSettings(env.project, {
74 allowRequestRole: true,
75 allowJustInTimeAccess: enabled,
76 });
77 // Force-reload the viewer's page so the store picks up the new
78 // project flag. The SQL Editor caches project state per-tab; flipping
79 // the flag via API does not in-flight invalidate that cache.
80 await viewerEditor.gotoWithDb(projectId, env.instanceId, env.databaseId);
81 await viewerPage.waitForTimeout(1500);
82}
83
84test.beforeAll(async ({ browser }) => {
85 test.setTimeout(180_000);

Callers 1

Calls 2

updateProjectSettingsMethod · 0.80
gotoWithDbMethod · 0.45

Tested by

no test coverage detected