mtg-playerinfo 1.3.2 → 1.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/fetchers/topdeck.js +17 -0
- package/test/data/topdeck.html +2 -2
- package/test/data/unityLeague.html +57 -33
- package/test/data/untapped.json +1 -1
- package/test/topdeck.test.js +3 -0
- package/test/untapped.test.js +3 -3
package/test/topdeck.test.js
CHANGED
|
@@ -23,6 +23,9 @@ test('TopdeckFetcher: parseHtml extracts stats from DOM when available', () => {
|
|
|
23
23
|
assert.equal(result.source, 'Topdeck')
|
|
24
24
|
assert.equal(result.url, url)
|
|
25
25
|
assert.equal(result.name, 'Björn Kimminich')
|
|
26
|
+
assert.equal(result.pronouns, 'He/Him', 'Should extract pronouns from badge')
|
|
27
|
+
assert.equal(result.twitter, 'https://twitter.com/bkimminich', 'Should extract Twitter link')
|
|
28
|
+
assert.equal(result.youtube, 'https://www.youtube.com/@Bj%C3%B6rnKimminich', 'Should extract YouTube link')
|
|
26
29
|
})
|
|
27
30
|
|
|
28
31
|
test('TopdeckFetcher: fetchStats updates playerInfo with data from stats JSON', async () => {
|
package/test/untapped.test.js
CHANGED
|
@@ -22,12 +22,12 @@ test('UntappedFetcher: parses most recent match and extracts MTGA rank', () => {
|
|
|
22
22
|
|
|
23
23
|
assert.strictEqual(typeof result.mtga_rank, 'object')
|
|
24
24
|
|
|
25
|
-
// Format is either "Rank Tier" (e.g. "Diamond 2") or "Mythic #Place" (e.g. "Mythic #123")
|
|
25
|
+
// Format is either "Rank Tier" (e.g. "Diamond 2") or "Mythic #Place" or "Mythic Percentile%" (e.g. "Mythic #123" or "Mythic 98.67%")
|
|
26
26
|
if (result.mtga_rank.constructed !== undefined) {
|
|
27
|
-
assert.match(result.mtga_rank.constructed, /^(Bronze|Silver|Gold|Platinum|Diamond|Mythic)(\s\d+|\s#\d+)$/)
|
|
27
|
+
assert.match(result.mtga_rank.constructed, /^(Bronze|Silver|Gold|Platinum|Diamond|Mythic)(\s\d+|\s#\d+|\s\d+(\.\d+)?%)$/)
|
|
28
28
|
}
|
|
29
29
|
if (result.mtga_rank.limited !== undefined) {
|
|
30
|
-
assert.match(result.mtga_rank.limited, /^(Bronze|Silver|Gold|Platinum|Diamond|Mythic)(\s\d+|\s#\d+)$/)
|
|
30
|
+
assert.match(result.mtga_rank.limited, /^(Bronze|Silver|Gold|Platinum|Diamond|Mythic)(\s\d+|\s#\d+|\s\d+(\.\d+)?%)$/)
|
|
31
31
|
}
|
|
32
32
|
})
|
|
33
33
|
|