add a test for empty ID, fix some linting

This commit is contained in:
2024-08-04 07:30:35 -06:00
parent 9213ad1f4a
commit 052d5c5bd1
5 changed files with 33 additions and 8 deletions

View File

@@ -5,10 +5,13 @@ test('Confirm usage of test API', async ({ page }, testInfo) => {
await page.goto('./account');
await page.getByRole('heading', { name: 'Advanced' }).click();
// look into the config file: if it starts Time Safari, it might say which server it should set by default
const webServer = testInfo.config.webServer;
const endorserWords = webServer?.command.split(' ');
const ENDORSER_ENV_NAME = 'VITE_DEFAULT_ENDORSER_API_SERVER';
const endorserTerm = endorserWords?.find(word => word.startsWith(ENDORSER_ENV_NAME + '='));
const endorserServer = endorserTerm?.substring(ENDORSER_ENV_NAME.length + 1) || 'https://test-api.endorser.ch';
const endorserTermInConfig = endorserTerm?.substring(ENDORSER_ENV_NAME.length + 1);
const endorserServer = endorserTermInConfig || 'https://test-api.endorser.ch';
await expect(page.getByRole('textbox').nth(1)).toHaveValue(endorserServer);
});

View File

@@ -17,4 +17,7 @@ test('Check no-ID messaging in account', async ({ page }) => {
// Check 'a friend needs to register you' notice
await expect(page.locator('#noticeBeforeAnnounce')).toBeVisible();
// Check that there is no ID
await expect(page.locator('#sectionIdentityDetails code.truncate')).toBeEmpty();
});