Skip to content

Commit

Permalink
fix: ws routes in e2e
Browse files Browse the repository at this point in the history
  • Loading branch information
m8vago committed Jan 6, 2025
1 parent db14aef commit 23a152d
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions web/crux-ui/e2e/with-login/resource-copy.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { WS_TYPE_PATCH_CONFIG, WS_TYPE_PATCH_INSTANCE } from '@app/models'
import { WS_TYPE_PATCH_CONFIG } from '@app/models'
import { expect } from '@playwright/test'
import { DAGENT_NODE, NGINX_TEST_IMAGE_WITH_TAG, TEAM_ROUTES, waitForURLExcept } from 'e2e/utils/common'
import { addPortsToContainerConfig } from 'e2e/utils/container-config'
Expand Down Expand Up @@ -189,11 +189,12 @@ test.describe('Deleting default version', () => {
await settingsButton.click()

await page.waitForSelector(`h2:has-text("Instance config")`)
const wsRoute = TEAM_ROUTES.deployment.detailsSocket(defaultDeploymentId)
const instanceConfigId = page.url().split('/').pop()
const wsRoute = TEAM_ROUTES.containerConfig.detailsSocket(instanceConfigId)

const internal = '1000'
const external = '2000'
await addPortsToContainerConfig(page, ws, wsRoute, WS_TYPE_PATCH_INSTANCE, internal, external)
await addPortsToContainerConfig(page, ws, wsRoute, WS_TYPE_PATCH_CONFIG, internal, external)

const newVersionId = await createVersion(page, projectId, 'new-version', 'Rolling')

Expand Down Expand Up @@ -289,11 +290,12 @@ test.describe("Deleting copied deployment's parent", () => {
await page.waitForURL(`/**/container-configurations/**`)
await page.waitForSelector('h2:text-is("Instance config")')

const wsRoute = TEAM_ROUTES.deployment.detailsSocket(parentDeploymentId)
const instanceConfigId = page.url().split('/').pop()
const wsRoute = TEAM_ROUTES.containerConfig.detailsSocket(instanceConfigId)

const internal = '1000'
const external = '2000'
await addPortsToContainerConfig(page, ws, wsRoute, WS_TYPE_PATCH_INSTANCE, internal, external)
await addPortsToContainerConfig(page, ws, wsRoute, WS_TYPE_PATCH_CONFIG, internal, external)

await page.goto(TEAM_ROUTES.deployment.details(parentDeploymentId))
await page.waitForSelector('h2:text-is("Deployments")')
Expand Down

0 comments on commit 23a152d

Please sign in to comment.