From 052d5c5bd158cb12556e85ba0ef0307ef10cdae3 Mon Sep 17 00:00:00 2001 From: Trent Larson Date: Sun, 4 Aug 2024 07:30:35 -0600 Subject: [PATCH] add a test for empty ID, fix some linting --- src/views/AccountViewView.vue | 25 +++++++++++++++---- src/views/ContactsView.vue | 6 ++++- src/views/DIDView.vue | 2 +- test-playwright/00-confirm-test-api.spec.ts | 5 +++- .../03-check-noid-messaging.spec.ts | 3 +++ 5 files changed, 33 insertions(+), 8 deletions(-) diff --git a/src/views/AccountViewView.vue b/src/views/AccountViewView.vue index 519aac234..acb2d4e49 100644 --- a/src/views/AccountViewView.vue +++ b/src/views/AccountViewView.vue @@ -53,7 +53,10 @@ -
+

{{ givenName }} @@ -177,7 +180,10 @@

-
+
Notifications
-
+
Location for Searches
-
+
Data Export
Deep Identifier Details -
+
Public Key (base 64)
-
    +
    • { 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); }); \ No newline at end of file diff --git a/test-playwright/03-check-noid-messaging.spec.ts b/test-playwright/03-check-noid-messaging.spec.ts index 8ae27d34d..4e855796c 100644 --- a/test-playwright/03-check-noid-messaging.spec.ts +++ b/test-playwright/03-check-noid-messaging.spec.ts @@ -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(); }); \ No newline at end of file