Skip to content

Commit

Permalink
fix(*): service query endpoint (#115) (#116)
Browse files Browse the repository at this point in the history
  • Loading branch information
Leopoldthecoder authored Oct 25, 2023
1 parent 8e8c0be commit 11523eb
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 21 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"@kong-ui-public/entities-key-sets": "^1.2.5",
"@kong-ui-public/entities-keys": "^1.2.5",
"@kong-ui-public/entities-plugins": "^1.4.6",
"@kong-ui-public/entities-routes": "^1.1.2",
"@kong-ui-public/entities-routes": "^1.2.11",
"@kong-ui-public/entities-shared": "^1.2.4",
"@kong-ui-public/entities-snis": "^1.1.36",
"@kong-ui-public/entities-upstreams-targets": "^1.3.5",
Expand Down
38 changes: 19 additions & 19 deletions tests/playwright/specs/routes/01-Routes.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -219,15 +219,15 @@ test.describe('routes', () => {

test(`view the route "${mockRouteName}" detail page`, async ({ page }) => {
await withNavigation(page, async () => await clickEntityListAction(page, 'view'))
await expect(page.getByTestId('name-property-value')).toHaveText(mockRouteName)
await expect(page.getByTestId('name-property-value')).toContainText(mockRouteName)
})

test('routes show - links to service with a name', async ({ page }) => {
await withNavigation(page, async () => await clickEntityListAction(page, 'view'))

await page.getByTestId('service-property-value').locator('.navigation-button').click()

await expect(page.getByTestId('name-property-value')).toHaveText(mockServiceName)
await expect(page.getByTestId('name-property-value')).toContainText(mockServiceName)
})

test(`cancel the route "${mockRouteName}" editing`, async ({ page }) => {
Expand Down Expand Up @@ -385,9 +385,9 @@ test.describe('routes', () => {
}
}, data,
async () => {
await expect(page.getByTestId('strip_path-property-value')).toHaveText(`${isStripPath}`)
await expect(page.getByTestId('methods-property-value')).toHaveText(['GET'])
await expect(page.getByTestId('tags-property-value')).toHaveText(['tag1tag2'])
await expect(page.getByTestId('strip_path-property-value')).toContainText(`${isStripPath}`)
await expect(page.getByTestId('methods-property-value')).toContainText(['GET'])
await expect(page.getByTestId('tags-property-value')).toContainText(['tag1tag2'])
})
}
})
Expand Down Expand Up @@ -421,9 +421,9 @@ test.describe('routes', () => {
await expect(page.getByTestId('route-form-strip-path')).not.toBeVisible()
}, data,
async () => {
await expect(page.getByTestId('protocols-property-value')).toHaveText(`${protocol}`.replace(',', ''))
await expect(page.getByTestId('methods-property-value')).toHaveText(' – ') // todo: this property should not visible here
await expect(page.getByTestId('strip_path-property-value')).toHaveText('false') // todo: this property should not visible here
await expect(page.getByTestId('protocols-property-value')).toContainText(`${protocol}`.replace(',', ''))
await expect(page.getByTestId('methods-property-value')).toContainText(' – ') // todo: this property should not visible here
await expect(page.getByTestId('strip_path-property-value')).toContainText('false') // todo: this property should not visible here
})
}
})
Expand Down Expand Up @@ -460,9 +460,9 @@ test.describe('routes', () => {
await page.getByTestId('route-form-sources-port-input-2').fill('4321')
}, data,
async () => {
await expect(page.getByTestId('protocols-property-value')).toHaveText(`${protocol}`.replace(/,/g, ''))
await expect(page.getByTestId('methods-property-value')).toHaveText(' – ') // todo: this property should not visible here
await expect(page.getByTestId('hosts-property-value')).toHaveText(' – ') // todo: this property should not visible here
await expect(page.getByTestId('protocols-property-value')).toContainText(`${protocol}`.replace(/,/g, ''))
await expect(page.getByTestId('methods-property-value')).toContainText(' – ') // todo: this property should not visible here
await expect(page.getByTestId('hosts-property-value')).toContainText(' – ') // todo: this property should not visible here
})
}
})
Expand Down Expand Up @@ -495,9 +495,9 @@ test.describe('routes', () => {
await selectMethods(page, ['GET'])
}, data,
async () => {
await expect(page.getByTestId('protocols-property-value')).toHaveText('http')
await expect(page.getByTestId('methods-property-value')).toHaveText(['GET'])
await expect(page.getByTestId('sources-property-value')).toHaveText(' – ') // todo: this property should not visible here
await expect(page.getByTestId('protocols-property-value')).toContainText('http')
await expect(page.getByTestId('methods-property-value')).toContainText(['GET'])
await expect(page.getByTestId('sources-property-value')).toContainText(' – ') // todo: this property should not visible here
})
})

Expand All @@ -512,7 +512,7 @@ test.describe('routes', () => {
await fillArrayField(page, 'hosts', ['localhost'])
}, data,
async () => {
await expect(page.getByTestId('protocols-property-value')).toHaveText('httphttps')
await expect(page.getByTestId('protocols-property-value')).toContainText('httphttps')
})
})

Expand All @@ -528,7 +528,7 @@ test.describe('routes', () => {
await fillArrayField(page, 'hosts', ['localhost'])
}, data,
async () => {
await expect(page.getByTestId('protocols-property-value')).toHaveText('https')
await expect(page.getByTestId('protocols-property-value')).toContainText('https')
})
})

Expand All @@ -544,7 +544,7 @@ test.describe('routes', () => {
await fillArrayField(page, 'paths', ['/kong(-ee){0,1}.com'], true)
}, data,
async () => {
await expect(page.getByTestId('paths-property-value')).toHaveText(['/kong(-ee){0,1}.com'])
await expect(page.getByTestId('paths-property-value')).toContainText(['/kong(-ee){0,1}.com'])
})
})

Expand All @@ -559,7 +559,7 @@ test.describe('routes', () => {
await selectMethods(page, ['GET'])
}, data,
async () => {
await expect(page.getByTestId('service-property-value')).toHaveText(serviceWithNoName.id)
await expect(page.getByTestId('service-property-value')).toContainText(serviceWithNoName.id)
})
})

Expand Down Expand Up @@ -609,6 +609,6 @@ test.describe('routes', () => {

await page.goto(`/routes/${route?.data.id}`)

await expect(page.getByTestId('service-property-value')).toHaveText('-')
await expect(page.getByTestId('service-property-value')).toContainText('-')
})
})
36 changes: 35 additions & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -346,13 +346,25 @@
resolved "https://registry.yarnpkg.com/@kong-ui-public/copy-uuid/-/copy-uuid-1.3.1.tgz#22010052c588157738a33d45739c2330a6b8b57f"
integrity sha512-2w53UHf0Ylq9zbUSWO+wgVP26DUupZ0ddAK7CR44VRYBYXR5SIi0qeu/h/3936RB0rNQ3Tyk5xMUMdMkMkS56Q==

"@kong-ui-public/copy-uuid@^1.3.4":
version "1.3.4"
resolved "https://registry.yarnpkg.com/@kong-ui-public/copy-uuid/-/copy-uuid-1.3.4.tgz#fd19eb6aee69f8876cb2b78357b8da961e76a830"
integrity sha512-gIE4y4jyWWkY2wFdE4HMsCQJveyD8UBdvLjL1MB4E3hwOcakTnpjxm4XiA6JML9SCjqbrGe9CUTANle22yutgw==

"@kong-ui-public/core@^1.4.1":
version "1.4.1"
resolved "https://registry.yarnpkg.com/@kong-ui-public/core/-/core-1.4.1.tgz#ab3c91763fc033c725697d11bdce561eb852ae6d"
integrity sha512-aGP+zXIaXG99z7xhtc2vDF0wieNtiU3oj00wXsMvGYQ1R4ywBSL3Jz3dXTq8k1KmXDkY7AH5wiJUG6zLPIfqSA==
dependencies:
date-fns "^2.30.0"

"@kong-ui-public/core@^1.4.3":
version "1.4.3"
resolved "https://registry.yarnpkg.com/@kong-ui-public/core/-/core-1.4.3.tgz#4634e6a8a96e43e71dc95fda0e6971a698846e59"
integrity sha512-pyiVpPt0q9fz+akYbmHQshxOPboy6HGtPE6BAs9TPuWBAEVKhlDL8KsdhO9LSkp0juom8DLCRd9HOv/eAIXf+Q==
dependencies:
date-fns "^2.30.0"

"@kong-ui-public/entities-certificates@^1.3.5":
version "1.3.5"
resolved "https://registry.yarnpkg.com/@kong-ui-public/entities-certificates/-/entities-certificates-1.3.5.tgz#906634c907ba1aa4ba128fcb57a49870471c4f5a"
Expand Down Expand Up @@ -416,7 +428,14 @@
"@kong-ui-public/entities-routes" "^1.2.5"
"@kong-ui-public/entities-shared" "^1.6.3"

"@kong-ui-public/entities-routes@^1.1.2", "@kong-ui-public/entities-routes@^1.2.5":
"@kong-ui-public/entities-routes@^1.2.11":
version "1.2.11"
resolved "https://registry.yarnpkg.com/@kong-ui-public/entities-routes/-/entities-routes-1.2.11.tgz#d186e13d92237ceaefe8daf55e2b243026cc0798"
integrity sha512-Q2DDPPeiLXbf/fJM/LidXThWlW5z/iQ/HFdpPdwJbzaOUAMTqwUgsr/sLhfYeXNZuFHqCfAFsvkn/aQeTkT4uQ==
dependencies:
"@kong-ui-public/entities-shared" "^1.6.8"

"@kong-ui-public/entities-routes@^1.2.5":
version "1.2.5"
resolved "https://registry.yarnpkg.com/@kong-ui-public/entities-routes/-/entities-routes-1.2.5.tgz#83d9bbc123b29d1ff49def178c4749b0b399c106"
integrity sha512-nopHhZ+tzS/gNVC91G0jCQ1gNgjBlZpCFxpHSS2l1PxIOoO1fzupsClC8EW46KiwJdKX+jXpb+AE+QLiASLSyQ==
Expand All @@ -433,6 +452,16 @@
"@kong/icons" "^1.7.6"
compare-versions "^6.1.0"

"@kong-ui-public/entities-shared@^1.6.8":
version "1.6.8"
resolved "https://registry.yarnpkg.com/@kong-ui-public/entities-shared/-/entities-shared-1.6.8.tgz#74d50af1aa8a438c11394c89b450bc4b248501bc"
integrity sha512-Q1brhiBQ5P298Xa4ByzrbCKEf+ldT0OEGAXPrmK7MabZ7bUhNcs67Z7M3IORqMzU5odnS2jsCOd8BNgRWCYEcg==
dependencies:
"@kong-ui-public/copy-uuid" "^1.3.4"
"@kong-ui-public/core" "^1.4.3"
"@kong/icons" "^1.7.7"
compare-versions "^6.1.0"

"@kong-ui-public/entities-snis@^1.1.36":
version "1.1.36"
resolved "https://registry.yarnpkg.com/@kong-ui-public/entities-snis/-/entities-snis-1.1.36.tgz#bdfdb51fc68c012f1a75a57a2ffe0fb531e18827"
Expand Down Expand Up @@ -487,6 +516,11 @@
resolved "https://registry.yarnpkg.com/@kong/icons/-/icons-1.7.6.tgz#e3b210f7d326ae2082a10e0bbc437cce86012685"
integrity sha512-1/hyEJGpfI1j7LIM1HjWBCoUlFyhWoj9fAOZsJKX70C87XkCzEfxutD2eeSvE7KZe688oDnx7jXSiSouyly5BA==

"@kong/icons@^1.7.7":
version "1.7.7"
resolved "https://registry.yarnpkg.com/@kong/icons/-/icons-1.7.7.tgz#fbf11f02830ffb4319e7c20248e09ae1421c5bab"
integrity sha512-CQHOXZ/S0SRTjW43ItRKFoA9e+roW/jh8vXE1X0HVHDy0LAymvX9nadoVUmtdjNHQnJvr4XZfGgdyXE+fYh6Fw==

"@kong/kongponents@^8.123.9":
version "8.123.9"
resolved "https://registry.yarnpkg.com/@kong/kongponents/-/kongponents-8.123.9.tgz#b35f1470143e3e80f886eabcf7b61e74363abf20"
Expand Down

0 comments on commit 11523eb

Please sign in to comment.