From 4fd56809c1955b4f7b726aed102384ae4d407d17 Mon Sep 17 00:00:00 2001 From: Travis Briggs Date: Wed, 30 Oct 2024 20:01:48 -0700 Subject: [PATCH 1/2] Fix test due to upstream data change --- test/unit/saveArticles.test.ts | 2 +- test/unit/treatments/article.treatment.test.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/test/unit/saveArticles.test.ts b/test/unit/saveArticles.test.ts index 48fc593e..085a92c9 100644 --- a/test/unit/saveArticles.test.ts +++ b/test/unit/saveArticles.test.ts @@ -88,7 +88,7 @@ describe('saveArticles', () => { // Successfully scrapped existent articles expect(articleDoc.querySelector('meta[name="geo.position"]')).toBeDefined() // Geo Position data is correct - expect(articleDoc.querySelector('meta[name="geo.position"]')?.getAttribute('content')).toEqual('51.50722222;-0.1275') + expect(articleDoc.querySelector('meta[name="geo.position"]')?.getAttribute('content')).toEqual('51.5;-0.13333333') // Check if header exists expect(articleDoc.querySelector('h1.article-header, h1.pcs-edit-section-title')).toBeTruthy() }) diff --git a/test/unit/treatments/article.treatment.test.ts b/test/unit/treatments/article.treatment.test.ts index a212c08f..caaf5f19 100644 --- a/test/unit/treatments/article.treatment.test.ts +++ b/test/unit/treatments/article.treatment.test.ts @@ -94,7 +94,7 @@ describe('ArticleTreatment', () => { // Successfully scrapped existent articles expect(articleDoc.querySelector('meta[name="geo.position"]')).toBeDefined() // Geo Position data is correct - expect(articleDoc.querySelector('meta[name="geo.position"]')?.getAttribute('content')).toEqual('51.50722222;-0.1275') + expect(articleDoc.querySelector('meta[name="geo.position"]')?.getAttribute('content')).toEqual('51.5;-0.13333333') }) } }) From 58471b382219708254eafe8af090274304c4dc63 Mon Sep 17 00:00:00 2001 From: Travis Briggs Date: Wed, 30 Oct 2024 20:23:03 -0700 Subject: [PATCH 2/2] Live wiki has less articles now, change expectation --- test/e2e/bm.e2e.test.ts | 2 +- test/e2e/wikisource.e2e.test.ts | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/test/e2e/bm.e2e.test.ts b/test/e2e/bm.e2e.test.ts index 659f96ff..74034a4d 100644 --- a/test/e2e/bm.e2e.test.ts +++ b/test/e2e/bm.e2e.test.ts @@ -29,7 +29,7 @@ await testAllRenders(parameters, async (outFiles) => { if (dump.nopic) { // nopic has enough files (this is just an estimate and can change // with time, as new Mediwiki versions are released). - expect(dump.status.files.success).toBeGreaterThan(13) + expect(dump.status.files.success).toBeGreaterThan(12) expect(dump.status.files.success).toBeLessThan(22) // nopic has enough redirects expect(dump.status.redirects.written).toBeGreaterThan(170) diff --git a/test/e2e/wikisource.e2e.test.ts b/test/e2e/wikisource.e2e.test.ts index 9e514c4d..68c414f5 100644 --- a/test/e2e/wikisource.e2e.test.ts +++ b/test/e2e/wikisource.e2e.test.ts @@ -27,8 +27,9 @@ await testRenders( for (const dump of outFiles) { if (dump.nopic) { + console.log(dump.status.files.fail) // nopic has enough files - expect(dump.status.files.success).toBeGreaterThanOrEqual(14) + expect(dump.status.files.success).toBeGreaterThanOrEqual(13) // nopic has enough redirects expect(dump.status.redirects.written).toBeGreaterThanOrEqual(16) // nopic has enough articles @@ -50,7 +51,7 @@ await testRenders( for (const dump of outFiles) { if (dump.nopic) { // nopic has enough files - expect(dump.status.files.success).toBeGreaterThanOrEqual(14) + expect(dump.status.files.success).toBeGreaterThanOrEqual(13) // nopic has enough redirects expect(dump.status.redirects.written).toBeGreaterThanOrEqual(16) // nopic has enough articles