Module:Navbar/testcases

From Northumberland Climbing
< Module:Navbar
Revision as of 02:26, 22 May 2019 by module>Capankajsmilyo (run)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Production


----
h
h

----
V/doc
V/doc

----
----

Sandbox


----
h
h

----
V/doc
V/doc

----
----
--Quick and few tests of using the _navbar function directly, as they won't be caught in tests of {{navbar}}
local p = {}
local n = require('Module:Navbar')
local ns = require('Module:Navbar/sandbox')
require('Module:No globals') --make sure no globals

function p.run()
	local out = {}
	for i = 1,2 do
		local k = {'yes', nil}
		table.insert(out, {
		n._navbar({collapsible = k[i], template =  'V/doc'}),
		ns._navbar({collapsible = k[i], template = 'V/doc'}),
		'<br/>----',
		n._navbar({collapsible = k[i], template = 'V/doc', 'h', 'm', ''}),
		ns._navbar({collapsible = k[i], template = 'V/doc', 'h', 'm', ''}),
		'<br/>----',
		n._navbar({collapsible = k[i], 'V/doc', 'h', 'm'}),
		ns._navbar({collapsible = k[i], 'V/doc', 'h', 'm'})})
	end
	table.insert(out, {n._navbar{mini = 'yes', 'v/doc'},ns._navbar{mini = 'yes', 'v/doc'}})
	return table.concat(out[1])..table.concat(out[2])..table.concat(out[3])
end
return p