diff options
author | (quasar) nebula <qznebula@protonmail.com> | 2023-11-24 15:10:43 -0400 |
---|---|---|
committer | (quasar) nebula <qznebula@protonmail.com> | 2023-11-24 15:10:43 -0400 |
commit | a8d4f86d9456cc713430410287aedcd8ed32f48e (patch) | |
tree | 6553c7e0d0195fff9a5a678a1cbaf4ec9a012c40 /test/unit | |
parent | 5bc43a8bc8132a9d2cfa57937aa46fda56b663e5 (diff) | |
parent | eab0e06d148b5445feab453b8042d5e93e1fa1a2 (diff) |
Merge branch 'preview' into album-commentary-tweaks
Diffstat (limited to 'test/unit')
-rw-r--r-- | test/unit/data/things/track.js | 5 | ||||
-rw-r--r-- | test/unit/data/things/validators.js | 17 |
2 files changed, 14 insertions, 8 deletions
diff --git a/test/unit/data/things/track.js b/test/unit/data/things/track.js index 571624a5..f84ba1cb 100644 --- a/test/unit/data/things/track.js +++ b/test/unit/data/things/track.js @@ -189,13 +189,14 @@ t.test(`Track.color`, t => { // connection breaks for some future reason (with the album still present), // Track.color should still inherit directly from the album. wikiData.albumData = [ - new Proxy({ + { + constructor: {[Thing.referenceType]: 'album'}, color: '#abcdef', tracks: [track], trackSections: [ {color: '#baaaad', tracks: []}, ], - }, {getPrototypeOf: () => Album.prototype}), + }, ]; linkWikiDataArrays(); diff --git a/test/unit/data/things/validators.js b/test/unit/data/things/validators.js index bb33bf86..aa56a10e 100644 --- a/test/unit/data/things/validators.js +++ b/test/unit/data/things/validators.js @@ -149,13 +149,18 @@ t.test('isColor', t => { }); t.test('isCommentary', t => { - t.plan(6); + t.plan(9); + + // TODO: Test specific error messages. t.ok(isCommentary(`<i>Toby Fox:</i>\ndogsong.mp3`)); - t.ok(isCommentary(`Technically, this works:</i>`)); - t.ok(isCommentary(`<i><b>Whodunnit:</b></i>`)); - t.throws(() => isCommentary(123), TypeError); - t.throws(() => isCommentary(``), TypeError); - t.throws(() => isCommentary(`<i><u>Toby Fox:</u></i>`)); + t.ok(isCommentary(`<i>Toby Fox:</i> (music)\ndogsong.mp3`)); + t.throws(() => isCommentary(`dogsong.mp3\n<i>Toby Fox:</i>\ndogsong.mp3`)); + t.throws(() => isCommentary(`<i>Toby Fox:</i> dogsong.mp3`)); + t.throws(() => isCommentary(`<i>Toby Fox:</i> (music) dogsong.mp3`)); + t.throws(() => isCommentary(`<i>I Have Nothing To Say:</i>`)); + t.throws(() => isCommentary(123)); + t.throws(() => isCommentary(``)); + t.throws(() => isCommentary(`Technically, ah, er:</i>\nCorrect`)); }); t.test('isContribution', t => { |