-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(Tenant): fix infinite load if describe returns empty data (#1167)
- Loading branch information
Showing
4 changed files
with
65 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
import {expect, test} from '@playwright/test'; | ||
|
||
import {backend, tenantName} from '../../utils/constants'; | ||
|
||
import {TenantPage} from './TenantPage'; | ||
|
||
const pageQueryParams = { | ||
schema: tenantName, | ||
name: tenantName, | ||
tenantPage: 'diagnostics', | ||
}; | ||
|
||
test.describe('Tenant initial load', () => { | ||
test('Tenant diagnostics page is visible', async ({page}) => { | ||
const tenantPage = new TenantPage(page); | ||
await tenantPage.goto(pageQueryParams); | ||
|
||
await expect(page.locator('.kv-tenant-diagnostics')).toBeVisible(); | ||
}); | ||
|
||
test('Tenant diagnostics page is visible when describe returns no data', async ({page}) => { | ||
await page.route(`${backend}/viewer/json/describe?*`, async (route) => { | ||
await route.fulfill({json: ''}); | ||
}); | ||
|
||
const tenantPage = new TenantPage(page); | ||
await tenantPage.goto(pageQueryParams); | ||
|
||
await expect(page.locator('.kv-tenant-diagnostics')).toBeVisible(); | ||
}); | ||
|
||
test('Tenant page shows error message when describe returns 401', async ({page}) => { | ||
await page.route(`${backend}/viewer/json/describe?*`, async (route) => { | ||
await route.fulfill({status: 401}); | ||
}); | ||
|
||
const tenantPage = new TenantPage(page); | ||
await tenantPage.goto(pageQueryParams); | ||
|
||
await expect(page.locator('.empty-state')).toBeVisible(); | ||
await expect(page.locator('.empty-state__title')).toHaveText('Access denied'); | ||
}); | ||
|
||
test('Tenant page shows error message when describe returns 403', async ({page}) => { | ||
await page.route(`${backend}/viewer/json/describe?*`, async (route) => { | ||
await route.fulfill({status: 403}); | ||
}); | ||
|
||
const tenantPage = new TenantPage(page); | ||
await tenantPage.goto(pageQueryParams); | ||
|
||
await expect(page.locator('.empty-state')).toBeVisible(); | ||
await expect(page.locator('.empty-state__title')).toHaveText('Access denied'); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters