diff --git a/lua/spec/snapshots/teamcard_legacy.png b/lua/spec/snapshots/teamcard_legacy.png index a72353f8a68..eb0e93a8810 100644 Binary files a/lua/spec/snapshots/teamcard_legacy.png and b/lua/spec/snapshots/teamcard_legacy.png differ diff --git a/lua/spec/teamcard_legacy_spec.lua b/lua/spec/teamcard_legacy_spec.lua index ef0d9169b39..655438aec4d 100644 --- a/lua/spec/teamcard_legacy_spec.lua +++ b/lua/spec/teamcard_legacy_spec.lua @@ -643,6 +643,14 @@ describe('TeamCard Legacy', function() c1 = 'Coach Name', qualifier = 'Invited', }, 'LegacyTeamCard') + Template.stashReturnValue({ + __source = 'card', + team = 'mouz', + team2 = 'g2', + team3 = 'bds', + defaultRowNumber = '5', + qualifier = '[[Qualifier/2025|Qualifier]]', + }, 'LegacyTeamCard') Template.stashReturnValue({ __source = 'card', team = 'mouz', diff --git a/lua/test_assets/team_template_data.lua b/lua/test_assets/team_template_data.lua index 474950b426c..4ba6b6c6acf 100644 --- a/lua/test_assets/team_template_data.lua +++ b/lua/test_assets/team_template_data.lua @@ -1,6 +1,8 @@ local aliases = { bds = 'team bds', ['bds esport'] = 'team bds', + g2 = 'g2 esports', + gamers2 = 'g2 esports', mousesports = 'mouz', skt = 't1', ['sk telecom t1'] = 't1', @@ -17,6 +19,12 @@ local data = { ['2020-02-12'] = 'exon feb 2020', ['2020-03-10'] = 'exon march 2020', }, + ['g2 esports'] = { + ['0000-01-01'] = 'gamers2 orig', + ['2015-01-26'] = 'gamers2 2015', + ['2015-10-15'] = 'g2 esports 2015', + ['2019-01-14'] = 'g2 esports 2019', + }, ['team bds'] = { ['0000-01-01'] = 'bds esport old', ['2019-09-01'] = 'team bds orig', @@ -288,6 +296,39 @@ local data = { templatename = "heroic 2024", }, -- g2 subtemplate + ['gamers2 orig'] = { + bracketname = "Gamers2", + image = "Gamers2 allmode.png", + imagedark = "Gamers2 allmode.png", + legacyimage = "", + legacyimagedark = "", + name = "Gamers2", + page = "Gamers2", + shortname = "G2", + templatename = "gamers2 orig", + }, + ['gamers2 2015'] = { + bracketname = "Gamers2", + image = "Gamers2 lightmode.png", + imagedark = "Gamers2 darkmode.png", + legacyimage = "", + legacyimagedark = "", + name = "Gamers2", + page = "Gamers2", + shortname = "G2", + templatename = "gamers2 2015", + }, + ['g2 esports 2015'] = { + bracketname = "G2 Esports", + image = "G2 Esports allmode.png", + imagedark = "G2 Esports allmode.png", + legacyimage = "", + legacyimagedark = "", + name = "G2 Esports", + page = "G2 Esports", + shortname = "G2", + templatename = "g2 esports 2015", + }, ['g2 esports 2019'] = { bracketname = "G2 Esports", image = "G2 Esports 2019 lightmode.png", diff --git a/lua/wikis/commons/TeamParticipants/Parse/Wiki.lua b/lua/wikis/commons/TeamParticipants/Parse/Wiki.lua index 308d45bb69c..ee503827390 100644 --- a/lua/wikis/commons/TeamParticipants/Parse/Wiki.lua +++ b/lua/wikis/commons/TeamParticipants/Parse/Wiki.lua @@ -144,7 +144,7 @@ function TeamParticipantsWikiParser.parseParticipant(input, defaultDate) table.insert(warnings, 'Invalid contenders: expected a list of non-empty strings') else Array.forEach(contenderNames, function(name, idx) - if type(name) ~= 'string' or name == '' then + if type(name) ~= 'string' or String.isEmpty(name) or string.lower(name) == 'tbd' then table.insert(warnings, string.format('Invalid contender entry at position %d: %s', idx, tostring(name))) return end