Skip to content

Commit

Permalink
Pass the CI
Browse files Browse the repository at this point in the history
  • Loading branch information
MBilalShafi committed May 16, 2023
1 parent 2d9b22a commit dc029a1
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,7 @@ export const addFooterRows = ({
};

insertNodeInTree({
previousTree: null,
node: footerNode,
tree: newGroupingParams.tree,
treeDepths: newGroupingParams.treeDepths,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export function addPinnedRow({
isAutoGenerated,
};

insertNodeInTree({ node, tree, treeDepths });
insertNodeInTree({ previousTree: null, node, tree, treeDepths });

if (!isAutoGenerated) {
dataRowIdToModelLookup[rowId] = rowModel!;
Expand Down
10 changes: 10 additions & 0 deletions packages/grid/x-data-grid-pro/src/utils/tree/createRowTree.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ describe('createRowTree', () => {
},
],
defaultGroupingExpansionDepth: 0,
previousTree: null,
});

expect(getGroupExpansion(response.tree)).to.deep.equal([
Expand Down Expand Up @@ -57,6 +58,7 @@ describe('createRowTree', () => {
},
],
defaultGroupingExpansionDepth: 1,
previousTree: null,
});

expect(getGroupExpansion(response.tree)).to.deep.equal([
Expand All @@ -81,6 +83,7 @@ describe('createRowTree', () => {
},
],
defaultGroupingExpansionDepth: 1,
previousTree: null,
});

expect(getGroupExpansion(response.tree)).to.deep.equal([
Expand Down Expand Up @@ -113,6 +116,7 @@ describe('createRowTree', () => {
},
],
defaultGroupingExpansionDepth: -1,
previousTree: null,
});

expect(getGroupExpansion(response.tree)).to.deep.equal([
Expand All @@ -139,6 +143,7 @@ describe('createRowTree', () => {
},
],
defaultGroupingExpansionDepth: 0,
previousTree: null,
});

expect((response.tree[GRID_ROOT_GROUP_ID] as GridGroupNode).children).includes(0);
Expand All @@ -162,6 +167,7 @@ describe('createRowTree', () => {
},
],
defaultGroupingExpansionDepth: 0,
previousTree: null,
});

expect((response.tree[0] as GridGroupNode).children).to.includes(
Expand Down Expand Up @@ -192,6 +198,7 @@ describe('createRowTree', () => {
},
],
defaultGroupingExpansionDepth: 0,
previousTree: null,
});

expect(response.tree[0].parent).to.equal('auto-generated-row-null/A');
Expand Down Expand Up @@ -221,6 +228,7 @@ describe('createRowTree', () => {
},
],
defaultGroupingExpansionDepth: -1,
previousTree: null,
});

// The tree created looks like this:
Expand Down Expand Up @@ -252,6 +260,7 @@ describe('createRowTree', () => {
{ id: 0, path: [{ key: 'A', field: null }] },
],
defaultGroupingExpansionDepth: 0,
previousTree: null,
});

expect((response.tree[GRID_ROOT_GROUP_ID] as GridGroupNode).children).includes(0);
Expand Down Expand Up @@ -292,6 +301,7 @@ describe('createRowTree', () => {
},
],
defaultGroupingExpansionDepth: 0,
previousTree: null,
});

expect(response.treeDepths).to.deep.equal({ 0: 1, 1: 1, 2: 2 });
Expand Down

0 comments on commit dc029a1

Please sign in to comment.