Skip to content

Commit

Permalink
Merge pull request #2094 from openzim/fix-tests
Browse files Browse the repository at this point in the history
Fix test due to upstream data change
  • Loading branch information
audiodude authored Oct 31, 2024
2 parents cec75bd + 58471b3 commit 7cb66ae
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion test/e2e/bm.e2e.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
5 changes: 3 additions & 2 deletions test/e2e/wikisource.e2e.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion test/unit/saveArticles.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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()
})
Expand Down
2 changes: 1 addition & 1 deletion test/unit/treatments/article.treatment.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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')
})
}
})

0 comments on commit 7cb66ae

Please sign in to comment.