mirror of
https://github.com/Kong/insomnia.git
synced 2026-11-08 14:03:29 -05:00
29 lines
1.1 KiB
TypeScript
29 lines
1.1 KiB
TypeScript
import { MOCK_API_SERVER, SESSION_ID, test } from "@package/misc/fixtures";
|
|
import { expect } from "@playwright/test";
|
|
|
|
test("Verify a new remote commit becomes pullable on a Cloud-synced workspace after a main-window focus change", async ({
|
|
user,
|
|
}) => {
|
|
const { cloudSyncFlow, appFlow } = user.flowManager;
|
|
const { cloudSyncPage } = user.pageManager;
|
|
|
|
await cloudSyncFlow.fetch("My Environment");
|
|
await fetch(`${MOCK_API_SERVER}/_admin/cloud-sync/new-commit`, {
|
|
method: "PUT",
|
|
headers: { "Content-Type": "application/json" },
|
|
body: JSON.stringify({ enabled: true, sessionId: SESSION_ID }),
|
|
});
|
|
await cloudSyncPage.reselect("My Environment");
|
|
await appFlow.simulateMainWindowFocusChange();
|
|
const pullLabel = await cloudSyncPage.waitForPullAvailable();
|
|
await cloudSyncPage.closeSyncMenu();
|
|
|
|
await fetch(`${MOCK_API_SERVER}/_admin/cloud-sync/new-commit`, {
|
|
method: "PUT",
|
|
headers: { "Content-Type": "application/json" },
|
|
body: JSON.stringify({ enabled: false, sessionId: SESSION_ID }),
|
|
});
|
|
|
|
expect(pullLabel).toMatch(/Pull 1 Commit/);
|
|
});
|