Skip to content

Commit fe4aa23

Browse files
Update Tree example to not have first item selected
This allows manual testing of setting tabIndex/focus not on the first item.
1 parent ccaf071 commit fe4aa23

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

components/tree/__tests__/tree.browser-test.jsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -313,9 +313,10 @@ describe('Tree: ', () => {
313313

314314
it('has initial selection', function () {
315315
let selectedNode = this.wrapper
316-
.find('#example-tree-1')
316+
.find('#example-tree-2')
317317
.find('.slds-is-selected');
318-
expect(selectedNode).to.have.length(1);
318+
// Fruits, Watermelon, Tree Fruits
319+
expect(selectedNode).to.have.length(3);
319320
selectedNode = this.wrapper
320321
.find('#example-tree-5')
321322
.find('.slds-is-selected');

utilities/sample-data/tree/sample-nodes-with-initial-state.jsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,23 +3,25 @@ const treeNodesWithInitialState = [
33
label: 'Grains',
44
type: 'item',
55
id: 1,
6-
selected: true,
76
},
87
{
98
label: 'Fruits',
109
type: 'branch',
1110
id: 2,
1211
expanded: true,
12+
selected: true,
1313
nodes: [
1414
{
1515
label: 'Ground Fruits',
1616
type: 'branch',
1717
id: 4,
18+
expanded: true,
1819
nodes: [
1920
{
2021
label: 'Watermelon',
2122
type: 'item',
2223
id: 12,
24+
selected: true,
2325
},
2426
{
2527
label: 'Canteloupe',

0 commit comments

Comments
 (0)