Jump to content

Module:Ft.dk link/testcases

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Ysangkok (talk | contribs) at 18:47, 27 February 2020. The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
-- Unit tests for [[Module:{{ROOTPAGENAME}}]]. Click talk page to run tests.
local p = require('Module:UnitTests')
local ft_id = require('Module:Ft.dk link')

function p:test_ft_id()
    self:equals('ö handled correctly', ft_id.link_url('Q3744442'), 'https://www.thedanishparliament.dk/members/oezlem-sara-cekic')
    self:equals('ð and ú handled correctly', ft_id.link_url('Q845278'), 'https://www.thedanishparliament.dk/members/sjuroeur-skaale')

    self:equals('Entity without property returns empty string', ft_Id.link_url('Q1'), '')
    self:equals('Calling with nil returns empty string', ft_Id.link_url(nil), '')
    self:equals('"no value" returns empty string, testing with [[d:Q6372265#P7882]]', ft_Id.link_url('Q6372265'), '')
end

return p