feat(deploy): notify clients of new releases
This commit is contained in:
@@ -110,6 +110,20 @@ describe("production deployment contract", () => {
|
||||
);
|
||||
expect(workflow).not.toMatch(/playwright|chromium/iu);
|
||||
});
|
||||
|
||||
it("mounts the deployment stream and offers a full reload for new releases", async () => {
|
||||
const [layout, notifier, route] = await Promise.all([
|
||||
repositoryFile("app/layout.tsx"),
|
||||
repositoryFile("components/deployment-update-notifier.tsx"),
|
||||
repositoryFile("app/api/active/route.ts"),
|
||||
]);
|
||||
|
||||
expect(layout).toContain("<DeploymentUpdateNotifier");
|
||||
expect(notifier).toContain('new EventSource("/api/active")');
|
||||
expect(notifier).toContain("window.location.reload()");
|
||||
expect(notifier).toContain('label: "รีโหลด"');
|
||||
expect(route).toContain('channel.sendNamed("deployment", deploymentId)');
|
||||
});
|
||||
});
|
||||
|
||||
describe("environment template contract", () => {
|
||||
|
||||
Reference in New Issue
Block a user