test: fix e2e

pull/460/head
Varun Patil 2023-02-25 18:27:31 -08:00
parent 0c110ec46e
commit 4693bc1700
4 changed files with 5 additions and 5 deletions

View File

@ -12,6 +12,6 @@ test.describe("Open", () => {
test("Open folder", async ({ page }) => { test("Open folder", async ({ page }) => {
await page.locator("text=Local").click(); await page.locator("text=Local").click();
await page.waitForSelector('img[src*="api/image/preview"]'); await page.waitForSelector("img.ximg");
}); });
}); });

View File

@ -6,7 +6,7 @@ test.beforeEach(login("/"));
test.describe("Open", () => { test.describe("Open", () => {
test("Look for Images", async ({ page }) => { test("Look for Images", async ({ page }) => {
expect( expect(
await page.locator('img[src*="api/image/preview"]').count(), await page.locator("img.ximg").count(),
"Number of previews" "Number of previews"
).toBeGreaterThan(4); ).toBeGreaterThan(4);
await page.waitForTimeout(1000); await page.waitForTimeout(1000);
@ -52,7 +52,7 @@ test.describe("Open", () => {
await page.waitForTimeout(4000); // cache await page.waitForTimeout(4000); // cache
await page.reload(); // prevent stale cache issues await page.reload(); // prevent stale cache issues
await page.waitForTimeout(4000); // cache await page.waitForTimeout(4000); // cache
await page.waitForSelector('img[src*="api/image/preview"]'); await page.waitForSelector("img.ximg");
expect(await page.locator(`img[src="${src1}"]`).count()).toBe(0); expect(await page.locator(`img[src="${src1}"]`).count()).toBe(0);
expect(await page.locator(`img[src="${src2}"]`).count()).toBe(0); expect(await page.locator(`img[src="${src2}"]`).count()).toBe(0);
}); });

View File

@ -18,7 +18,7 @@
<div class="preview-container fill-block"> <div class="preview-container fill-block">
<div class="img-outer" v-for="info of previews" :key="info.fileid"> <div class="img-outer" v-for="info of previews" :key="info.fileid">
<XImg <XImg
class="fill-block" class="ximg fill-block"
:src="getPreviewUrl(info, true, 256)" :src="getPreviewUrl(info, true, 256)"
@error="$event.target.classList.add('error')" @error="$event.target.classList.add('error')"
/> />

View File

@ -46,7 +46,7 @@
> >
<XImg <XImg
ref="ximg" ref="ximg"
:class="['fill-block', `memories-thumb-${data.key}`]" :class="['ximg', 'fill-block', `memories-thumb-${data.key}`]"
draggable="false" draggable="false"
:src="src" :src="src"
:key="data.fileid" :key="data.fileid"