diff --git a/src/views/ContactAmountsView.vue b/src/views/ContactAmountsView.vue
index 98c955b11..0b3a0a960 100644
--- a/src/views/ContactAmountsView.vue
+++ b/src/views/ContactAmountsView.vue
@@ -271,7 +271,7 @@ export default class ContactAmountssView extends Vue {
// Make the xhr request payload
const payload = JSON.stringify({ jwtEncoded: vcJwt });
const url = this.apiServer + "/api/v2/claim";
- const headers = getHeaders(this.activeDid) as AxiosRequestHeaders;
+ const headers = (await getHeaders(this.activeDid)) as AxiosRequestHeaders;
try {
const resp = await this.axios.post(url, payload, { headers });
diff --git a/src/views/DiscoverView.vue b/src/views/DiscoverView.vue
index 4f73a836f..61b0669c2 100644
--- a/src/views/DiscoverView.vue
+++ b/src/views/DiscoverView.vue
@@ -265,6 +265,8 @@ export default class DiscoverView extends Vue {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
} catch (e: any) {
console.error("Error with feed load:", e);
+ // this sometimes gives different information
+ console.error("Error with feed load (error added): " + e);
this.$notify(
{
group: "alert",
diff --git a/src/views/NewEditProjectView.vue b/src/views/NewEditProjectView.vue
index 6d5f4d0f8..5c469f0a1 100644
--- a/src/views/NewEditProjectView.vue
+++ b/src/views/NewEditProjectView.vue
@@ -309,7 +309,7 @@ export default class NewEditProjectView extends Vue {
return;
}
try {
- const headers = getHeaders(this.activeDid) as AxiosRequestHeaders;
+ const headers = (await getHeaders(this.activeDid)) as AxiosRequestHeaders;
const response = await this.axios.delete(
DEFAULT_IMAGE_API_SERVER +
"/image/" +
diff --git a/src/views/ProjectViewView.vue b/src/views/ProjectViewView.vue
index 242960a25..0f4d18507 100644
--- a/src/views/ProjectViewView.vue
+++ b/src/views/ProjectViewView.vue
@@ -162,6 +162,7 @@
diff --git a/src/views/ProjectsView.vue b/src/views/ProjectsView.vue
index 663b331f1..165a85e6a 100644
--- a/src/views/ProjectsView.vue
+++ b/src/views/ProjectsView.vue
@@ -396,7 +396,7 @@ export default class ProjectsView extends Vue {
* @param token Authorization token
**/
async offerDataLoader(url: string) {
- const headers = getHeaders(this.activeDid);
+ const headers = await getHeaders(this.activeDid);
try {
this.isLoading = true;
@@ -443,7 +443,7 @@ export default class ProjectsView extends Vue {
async loadMoreOfferData(payload: boolean) {
if (this.offers.length > 0 && payload) {
const latestOffer = this.offers[this.offers.length - 1];
- await this.loadOffers(this.activeDid, `&beforeId=${latestOffer.jwtId}`);
+ await this.loadOffers(`&beforeId=${latestOffer.jwtId}`);
}
}
@@ -452,8 +452,8 @@ export default class ProjectsView extends Vue {
* @param issuerDid of the user
* @param urlExtra additional url parameters in a string
**/
- async loadOffers(issuerDid?: string, urlExtra: string = "") {
- const url = `${this.apiServer}/api/v2/report/offers?offeredByDid=${issuerDid}${urlExtra}`;
+ async loadOffers(urlExtra: string = "") {
+ const url = `${this.apiServer}/api/v2/report/offers?offeredByDid=${this.activeDid}${urlExtra}`;
await this.offerDataLoader(url);
}
diff --git a/src/views/SharedPhotoView.vue b/src/views/SharedPhotoView.vue
index 24f32da93..cf32e46a9 100644
--- a/src/views/SharedPhotoView.vue
+++ b/src/views/SharedPhotoView.vue
@@ -54,9 +54,11 @@
service code underneath. To fix this, first make sure you have latest
version by comparing your version at the bottom of "Help" with the
version at the bottom of https://timesafari.app/help in a browser. After
- that, it may eventually work, but you can speed up the process by clearing
- your data cache (in the browser on mobile, even if you installed it) and/or
- reinstalling the app (after backing up all your data, of course).
+ that, it may eventually work, but you can speed up the process by
+ clearing your data cache (in the browser on mobile, even if you
+ installed it) and/or reinstalling the app (after backing up all your
+ data, of course).
+
diff --git a/test-playwright/20-create-project.spec.ts b/test-playwright/20-create-project.spec.ts
index af22ff0b0..d7742bc7a 100644
--- a/test-playwright/20-create-project.spec.ts
+++ b/test-playwright/20-create-project.spec.ts
@@ -43,12 +43,10 @@ test('Create new project, then search for it', async ({ page }) => {
// Search for newly-created project in /projects
await page.goto('./projects');
await page.getByRole('link', { name: 'Projects', exact: true }).click();
- await page.waitForTimeout(3000); // Wait for a bit
await expect(page.locator('ul#listProjects li.border-b:nth-child(1)')).toContainText(finalRandomString); // Assumes newest project always appears first in the Projects tab list
// Search for newly-created project in /discover
await page.goto('./discover');
- await page.waitForTimeout(3000); // Wait for a bit
await page.getByPlaceholder('Search…').fill(finalRandomString);
await page.locator('#QuickSearch button').click();
await expect(page.locator('ul#listDiscoverResults li.border-b:nth-child(1)')).toContainText(finalRandomString);
diff --git a/test-playwright/30-record-gift.spec.ts b/test-playwright/30-record-gift.spec.ts
index 387be37fc..77dc3ff95 100644
--- a/test-playwright/30-record-gift.spec.ts
+++ b/test-playwright/30-record-gift.spec.ts
@@ -27,7 +27,7 @@ test('Record something given', async ({ page }) => {
await page.goto('./');
await page.getByRole('heading', { name: 'Unnamed/Unknown' }).click();
await page.getByPlaceholder('What was given').fill(finalTitle);
- await page.getByRole('spinbutton', { id: 'inputGivenAmount' }).fill(randomNonZeroNumber.toString());
+ await page.getByRole('spinbutton').fill(randomNonZeroNumber.toString());
await page.getByRole('button', { name: 'Sign & Send' }).click();
await expect(page.getByText('That gift was recorded.')).toBeVisible();
diff --git a/test-playwright/40-add-contact.spec.ts b/test-playwright/40-add-contact.spec.ts
index f6254745f..4bb765623 100644
--- a/test-playwright/40-add-contact.spec.ts
+++ b/test-playwright/40-add-contact.spec.ts
@@ -51,7 +51,7 @@ test('Add contact, record gift, confirm gift', async ({ page }) => {
// Record something given by new contact
await page.getByRole('heading', { name: contactName }).click();
await page.getByPlaceholder('What was given').fill(finalTitle);
- await page.getByRole('spinbutton').fill(randomNonZeroNumber.toString());
+ await page.getByRole('spinbutton', { id: 'inputGivenAmount' }).fill(randomNonZeroNumber.toString());
await page.getByRole('button', { name: 'Sign & Send' }).click();
await expect(page.getByText('That gift was recorded.')).toBeVisible();
diff --git a/test-playwright/50-record-offer.spec.ts b/test-playwright/50-record-offer.spec.ts
new file mode 100644
index 000000000..031c99ffe
--- /dev/null
+++ b/test-playwright/50-record-offer.spec.ts
@@ -0,0 +1,33 @@
+import { test, expect } from '@playwright/test';
+import { importUser } from './testUtils';
+
+test('Record an offer', async ({ page }) => {
+ // Generate a random string of 6 characters, skipping the "0." at the beginning
+ const randomString = Math.random().toString(36).substring(2, 8);
+ // Standard title prefix
+ const finalTitle = `Offer ${randomString}`;
+ const randomNonZeroNumber = Math.floor(Math.random() * 999) + 1;
+
+ // Create new ID for default user
+ await importUser(page);
+
+ // Select a project
+ await page.goto('./discover');
+ await page.locator('ul#listDiscoverResults li:nth-child(1)').click();
+
+ // Record an offer
+ await page.getByTestId('offerButton').click();
+ await page.getByTestId('inputDescription').fill(finalTitle);
+ await page.getByTestId('inputOfferAmount').fill(randomNonZeroNumber.toString());
+ await page.getByRole('button', { name: 'Sign & Send' }).click();
+ await expect(page.getByText('That offer was recorded.')).toBeVisible();
+
+ // Refresh home view and check gift
+ await page.goto('./projects');
+ await page.locator('li').filter({ hasText: `All ${randomNonZeroNumber} remaining` }).locator('a').first().click();
+ await expect(page.getByRole('heading', { name: 'Verifiable Claim Details' })).toBeVisible();
+ await expect(page.getByText(finalTitle, { exact: true })).toBeVisible();
+ const page1Promise = page.waitForEvent('popup');
+ await page.getByRole('link', { name: 'View on the Public Server' }).click();
+ const page1 = await page1Promise;
+});
\ No newline at end of file
diff --git a/test-playwright/testUtils.js b/test-playwright/testUtils.js
index 44706ed34..3cd2e5c4b 100644
--- a/test-playwright/testUtils.js
+++ b/test-playwright/testUtils.js
@@ -21,6 +21,8 @@ export async function importUser(page, id) {
await page.getByText('You have a seed').click();
await page.getByPlaceholder('Seed Phrase').fill(seedPhrase);
await page.getByRole('button', { name: 'Import' }).click();
+ await expect(page.locator('#sectionUsageLimits')).toContainText('You have done');
+ await expect(page.locator('#sectionUsageLimits')).toContainText('You have uploaded');
// Set name
await page.getByRole('link', { name: 'Set Your Name' }).click();