We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent da2bc6f commit 69a3119Copy full SHA for 69a3119
1 file changed
integration/testUtils/keylessHelpers.ts
@@ -0,0 +1,20 @@
1
+import type { Page } from '@playwright/test';
2
+
3
+/**
4
+ * Mocks the environment API call to return a claimed instance.
5
+ * Used in keyless mode tests to simulate an instance that has been claimed.
6
+ */
7
+export const mockClaimedInstanceEnvironmentCall = async (page: Page): Promise<void> => {
8
+ await page.route('*/**/v1/environment*', async route => {
9
+ const response = await route.fetch();
10
+ const json = await response.json();
11
+ const newJson = {
12
+ ...json,
13
+ auth_config: {
14
+ ...json.auth_config,
15
+ claimed_at: Date.now(),
16
+ },
17
+ };
18
+ await route.fulfill({ response, json: newJson });
19
+ });
20
+};
0 commit comments