source: Dev/trunk/src/client/dojox/wire/tests/programmatic/TreeAdapter.js

Last change on this file was 483, checked in by hendrikvanantwerpen, 11 years ago

Added Dojo 1.9.3 release.

File size: 698 bytes
Line 
1dojo.provide("dojox.wire.tests.programmatic.TreeAdapter");
2
3dojo.require("dojox.wire.TreeAdapter");
4
5tests.register("dojox.wire.tests.programmatic.TreeAdapter", [
6
7        function test_TreeAdapter_nodes(t){
8                var source = [
9                        {a: "A1", b: "B1", c: "C1"},
10                        {a: "A2", b: "B2", c: "C2"},
11                        {a: "A3", b: "B3", c: "C3"}
12                ];
13                var nodes = [
14                        {title: {property: "a"}, children: [
15                                {node: {property: "b"}},
16                                {title: {property: "c"}}
17                        ]}
18                ];
19                var value = new dojox.wire.TreeAdapter({object: source, nodes: nodes}).getValue();
20                t.assertEqual(source[0].a, value[0].title);
21                t.assertEqual(source[1].b, value[1].children[0].title);
22                t.assertEqual(source[2].c, value[2].children[1].title);
23        }
24
25]);
Note: See TracBrowser for help on using the repository browser.