MCPcopy Create free account
hub / github.com/adobe/react-spectrum / snapshot

Function snapshot

perf/test/layout.test.mjs:13–26  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

11
12const expected = {width: 600, total: 10000};
13function snapshot() {
14 return {
15 width: 600,
16 contentWidth: 598,
17 height: 300,
18 scrollTop: 1000,
19 rows: [
20 {id: 'item-10', index: 10, top: -20, height: 60, allocatedHeight: 60, width: 598},
21 {id: 'item-11', index: 11, top: 40, height: 100, allocatedHeight: 100, width: 598},
22 {id: 'item-12', index: 12, top: 140, height: 80, allocatedHeight: 80, width: 598},
23 {id: 'item-13', index: 13, top: 220, height: 100, allocatedHeight: 100, width: 598}
24 ]
25 };
26}
27
28test('a measured variable-height window fills the viewport without rendering the whole dataset', () => {
29 assert.equal(validLayout(snapshot(), expected), true);

Callers 1

layout.test.mjsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected