Module:Navbar/testcases

-- Quick and few tests of using the _navbar function directly, -- as they won't be caught in tests of

-- TODO: Convert to use Module:ScribuntoUnit

local p = {} require('Module:No globals') --make sure no globals

function p.run(frame) local toRun; if (type(frame) == 'table') then if (type(frame.args) == 'table'			and type(frame.getParent) == 'function') then toRun = frame.args.module else toRun = frame.module end end

local n = require(toRun and ( -- The "Module:" namespace prefix is case insensitive and can -- be preceded with a single colon mw.ustring.match(toRun, "^:?[Mm][Oo][Dd][Uu][Ll][Ee]:") and toRun or 'Module:' .. toRun)		or 'Module:Navbar')

local out = {} for i = 1,2 do		local k = {'yes', nil} table.insert(out, {			n._navbar({collapsible = k[i], template = 'V/doc'}),			'',			n._navbar({collapsible = k[i], template = 'V/doc', 'h', 'm', ''}),			'',			n._navbar({collapsible = k[i], 'V/doc', 'h', 'm'}),			''		}) end

table.insert(out, { n._navbar{mini = 'yes', 'v/doc'} }) return table.concat(out[1])..table.concat(out[2])..table.concat(out[3]) end return p