Skip to content

fix(site): Close WS and SE connections when they are not used #7187

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Apr 20, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix mocks
  • Loading branch information
BrunoQuaresma committed Apr 20, 2023
commit e34b373f53c6541636ae5e0a2764ae846d750701
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,13 @@ test("Use custom name and set it as active when publishing", async () => {
jest
.spyOn(api, "getTemplateVersion")
.mockResolvedValue({ ...MockTemplateVersion, id: "new-version-id" })
jest.spyOn(api, "watchBuildLogs").mockImplementation((_, onMessage) => {
onMessage(MockWorkspaceBuildLogs[0])
return Promise.resolve()
})
jest
.spyOn(api, "watchBuildLogsByTemplateVersionId")
.mockImplementation((_, options) => {
options.onMessage(MockWorkspaceBuildLogs[0])
options.onDone()
return jest.fn() as any
})
const buildButton = within(topbar).getByRole("button", {
name: "Build template",
})
Expand Down Expand Up @@ -97,10 +100,13 @@ test("Do not mark as active if promote is not checked", async () => {
jest
.spyOn(api, "getTemplateVersion")
.mockResolvedValue({ ...MockTemplateVersion, id: "new-version-id" })
jest.spyOn(api, "watchBuildLogs").mockImplementation((_, onMessage) => {
onMessage(MockWorkspaceBuildLogs[0])
return Promise.resolve()
})
jest
.spyOn(api, "watchBuildLogsByTemplateVersionId")
.mockImplementation((_, options) => {
options.onMessage(MockWorkspaceBuildLogs[0])
options.onDone()
return jest.fn() as any
})
const buildButton = within(topbar).getByRole("button", {
name: "Build template",
})
Expand Down Expand Up @@ -153,10 +159,13 @@ test("Patch request is not send when the name is not updated", async () => {
jest
.spyOn(api, "getTemplateVersion")
.mockResolvedValue({ ...MockTemplateVersion, id: "new-version-id" })
jest.spyOn(api, "watchBuildLogs").mockImplementation((_, onMessage) => {
onMessage(MockWorkspaceBuildLogs[0])
return Promise.resolve()
})
jest
.spyOn(api, "watchBuildLogsByTemplateVersionId")
.mockImplementation((_, options) => {
options.onMessage(MockWorkspaceBuildLogs[0])
options.onDone()
return jest.fn() as any
})
const buildButton = within(topbar).getByRole("button", {
name: "Build template",
})
Expand Down