MCPcopy
hub / github.com/winjs/winjs / testLayout

Function testLayout

tests/ListView/InitializationTest.ts:88–101  ·  view source on GitHub ↗
(layoutName)

Source from the content-addressed store, hash-verified

86 }
87
88 function testLayout(layoutName) {
89 var placeholder1 = document.getElementById("test1"),
90 placeholder2 = document.getElementById("test2"),
91 expectedLayout = WinJS.UI[layoutName],
92 listView1 = new ListView(placeholder1, { layout: { type: expectedLayout } }),
93 listView2 = new ListView(placeholder2, { layout: new expectedLayout() });
94
95 Helper.ListView.validateListView(listView1);
96 Helper.ListView.validateListView(listView2);
97 LiveUnit.Assert.isTrue(listView1.layout instanceof expectedLayout);
98 LiveUnit.Assert.isTrue(listView2.layout instanceof expectedLayout);
99 LiveUnit.Assert.isTrue(listView1._horizontal() === (layoutName.indexOf("GridLayout") == 0));
100 LiveUnit.Assert.isTrue(listView2._horizontal() === (layoutName.indexOf("GridLayout") == 0));
101 }
102
103 export class InitializationTests {
104

Callers 1

InitializationTestsClass · 0.70

Calls 3

_horizontalMethod · 0.80
getElementByIdMethod · 0.65
indexOfMethod · 0.65

Tested by

no test coverage detected