Browse Source

add a test for empty ID, fix some linting

playwright-pwa-install-test
Trent Larson 3 months ago
parent
commit
052d5c5bd1
  1. 25
      src/views/AccountViewView.vue
  2. 6
      src/views/ContactsView.vue
  3. 2
      src/views/DIDView.vue
  4. 5
      test-playwright/00-confirm-test-api.spec.ts
  5. 3
      test-playwright/03-check-noid-messaging.spec.ts

25
src/views/AccountViewView.vue

@ -53,7 +53,10 @@
</div>
<!-- Identity Details -->
<div id="sectionIdentityDetails" class="bg-slate-100 rounded-md overflow-hidden px-4 py-3 mb-4">
<div
id="sectionIdentityDetails"
class="bg-slate-100 rounded-md overflow-hidden px-4 py-3 mb-4"
>
<div v-if="givenName">
<h2 class="text-xl font-semibold mb-2">
{{ givenName }}
@ -177,7 +180,10 @@
</router-link>
</div>
<div id="sectionNotifications" class="bg-slate-100 rounded-md overflow-hidden px-4 py-4 mt-8 mb-8">
<div
id="sectionNotifications"
class="bg-slate-100 rounded-md overflow-hidden px-4 py-4 mt-8 mb-8"
>
<!-- label -->
<div class="mb-2 font-bold">Notifications</div>
<div
@ -213,7 +219,10 @@
</router-link>
</div>
<div id="sectionSearchLocation" class="bg-slate-100 rounded-md overflow-hidden px-4 py-4 mt-8 mb-8">
<div
id="sectionSearchLocation"
class="bg-slate-100 rounded-md overflow-hidden px-4 py-4 mt-8 mb-8"
>
<!-- label -->
<div class="mb-2 font-bold">Location for Searches</div>
<router-link
@ -280,7 +289,10 @@
</button>
</div>
<div id="sectionDataExport" class="bg-slate-100 rounded-md overflow-hidden px-4 py-4 mt-8 mb-8">
<div
id="sectionDataExport"
class="bg-slate-100 rounded-md overflow-hidden px-4 py-4 mt-8 mb-8"
>
<div class="mb-2 font-bold">Data Export</div>
<router-link
:to="{ name: 'seed-backup' }"
@ -343,7 +355,10 @@
<span class="text-slate-500 text-sm font-bold mb-2">
Deep Identifier Details
</span>
<div id="sectionDeepIdentifier" class="bg-slate-100 rounded-md overflow-hidden px-4 py-3 mb-4">
<div
id="sectionDeepIdentifier"
class="bg-slate-100 rounded-md overflow-hidden px-4 py-3 mb-4"
>
<div class="text-slate-500 text-sm font-bold">Public Key (base 64)</div>
<div
class="text-sm text-slate-500 flex justify-start items-center mb-1"

6
src/views/ContactsView.vue

@ -79,7 +79,11 @@
</div>
<!-- Results List -->
<ul id="listContacts" v-if="contacts.length > 0" class="border-t border-slate-300">
<ul
id="listContacts"
v-if="contacts.length > 0"
class="border-t border-slate-300"
>
<li
class="border-b border-slate-300 pt-2.5 pb-4"
v-for="contact in contacts"

2
src/views/DIDView.vue

@ -198,7 +198,7 @@ export default class DIDView extends Vue {
if (pathParam) {
this.viewingDid = decodeURIComponent(pathParam);
this.contact = await db.contacts.get(this.viewingDid);
this.contactYaml = yaml.dump(this.contact)
this.contactYaml = yaml.dump(this.contact);
await this.loadClaimsAbout();
} else {
this.$notify(

5
test-playwright/00-confirm-test-api.spec.ts

@ -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);
});

3
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();
});
Loading…
Cancel
Save