Skip to main content

test: fix the failing tests

ID
4502cbc
date
2026-08-10 03:30:39+00:00
author
Alex Chan <alex@alexwlchan.net>
parent
afc247e
message
test: fix the failing tests
changed files
1 file, 14 additions, 14 deletions

Changed files

test/app.js (2491 → 2597)

diff --git a/test/app.js b/test/app.js
index f3913ab..a5ac31a 100644
--- a/test/app.js
+++ b/test/app.js
@@ -1,7 +1,7 @@
 QUnit.module('getKeyFicInfo', () => {
   function assertGetsTheRightKeyInfo(assert, path, expectedInfo) {
     const done = assert.async();
-    
+
     JSZipUtils.getBinaryContent(path, function(err, data) {
       if (err) {
         throw err;
@@ -14,7 +14,7 @@ QUnit.module('getKeyFicInfo', () => {
       });
     });
   }
-  
+
   // This EPUB file was downloaded from one of my fics,
   // retrieved 26 January 2025
   QUnit.test('it finds the key info from one of my fics', (assert) => {
@@ -28,7 +28,7 @@ QUnit.module('getKeyFicInfo', () => {
       }
     );
   });
-  
+
   // This EPUB file was downloaded from David MacIver's fic "Stargate Physics",
   // retrieved 26 January 2025
   QUnit.test('it finds the fandom if there are multiple fandoms', (assert) => {
@@ -51,18 +51,18 @@ QUnit.module('getKeyFicInfo', () => {
 QUnit.module('chooseColour', () => {
   QUnit.test('it chooses the colour in a reproducible way', (assert) => {
     const fandom = 'Operation Mincemeat: A New Musical - SpitLip';
-    assert.equal(chooseColour(fandom), '#098262');
+    assert.deepEqual(chooseColour(fandom), ["#0ca67d", "#075f48"]);
   });
-  
+
   QUnit.test('it chooses different colours for Star Wars and Star Trek', (assert) => {
-    assert.equal(chooseColour('Star Wars'), '#740ca3');
-    assert.equal(chooseColour('Star Trek'), '#08724b');
+    assert.deepEqual(chooseColour('Star Wars'), ["#760ca6", "#44075f"]);
+    assert.deepEqual(chooseColour('Star Trek'), ["#0ca66e", "#075f3f"]);
   });
-  
+
   QUnit.test('it creates the same colour for all Star Trek shows', (assert) => {
-    assert.equal(chooseColour('Star Trek'), '#08724b');
-    assert.equal(chooseColour('Star Trek TOS'), '#08724b');
-    assert.equal(chooseColour('Star Trek: Lower Decks'), '#08724b');
+    assert.deepEqual(chooseColour('Star Trek'),              ["#0ca66e", "#075f3f"]);
+    assert.deepEqual(chooseColour('Star Trek TOS'),          ["#0ca66e", "#075f3f"]);
+    assert.deepEqual(chooseColour('Star Trek: Lower Decks'), ["#0ca66e", "#075f3f"]);
   })
 });
 
@@ -77,11 +77,11 @@ QUnit.module('getTitleLines', () => {
     canvas.setAttribute("height", 900);
     const ctx = canvas.getContext("2d");
     ctx.font = '95px Georgia';
-  
+
     const lines = getTitleLines({
         ctx, title: 'Operation Cameo', maxWidth: 480,
     });
-  
+
     assert.deepEqual(lines, ['Operation', 'Cameo']);
-  });  
+  });
 });