-
Notifications
You must be signed in to change notification settings - Fork 671
T1328904 - TreeList — Auto-width columns are incorrectly resized in Firefox #34190
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
Tucchhaa
wants to merge
9
commits into
DevExpress:26_1
Choose a base branch
from
Tucchhaa:firefox_autowidth_26_1
base: 26_1
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+222
−19
Open
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
773aa3a
fix
Tucchhaa 3f0eccc
add tests
Tucchhaa 9f6d19d
update tests
Tucchhaa 3f3a9a5
apply review
Tucchhaa a207101
apply minor comment
Tucchhaa 5b3f137
apply review
Tucchhaa be50153
fix test
Tucchhaa e753ff7
test: resize always
Tucchhaa 8dc3136
Revert "test: resize always"
Tucchhaa File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
142 changes: 142 additions & 0 deletions
142
e2e/testcafe-devextreme/tests/common/treeList/column_auto_width.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,142 @@ | ||
| import { ClientFunction } from 'testcafe'; | ||
| import ExpandableCell from 'devextreme-testcafe-models/treeList/expandableCell'; | ||
| import TreeList from 'devextreme-testcafe-models/treeList'; | ||
| import url from '../../../helpers/getPageUrl'; | ||
| import { createWidget } from '../../../helpers/createWidget'; | ||
|
|
||
| fixture.disablePageReloads`Columns Auto Width` | ||
| .page(url(__dirname, '../../container.html')); | ||
|
|
||
| const treeListData = [ | ||
| { | ||
| id: 1, parentId: 0, name: 'Root item with a long name', size: 1024, date: '2024-01-01', | ||
| }, | ||
| { | ||
| id: 2, parentId: 1, name: 'Child 1', size: 512, date: '2024-02-01', | ||
| }, | ||
| { | ||
| id: 3, parentId: 1, name: 'Child 2 with a longer name value', size: 256, date: '2024-03-01', | ||
| }, | ||
| { | ||
| id: 4, parentId: 0, name: 'Second root', size: 2048, date: '2024-04-01', | ||
| }, | ||
| ]; | ||
|
|
||
| const treeListConfig = { | ||
| dataSource: treeListData, | ||
| keyExpr: 'id', | ||
| parentIdExpr: 'parentId', | ||
| columnAutoWidth: true, | ||
| width: 500, | ||
| repaintChangesOnly: true, | ||
| columns: [ | ||
| { dataField: 'name' }, | ||
| { dataField: 'size', width: 100 }, | ||
| { dataField: 'date', width: 150 }, | ||
| ], | ||
| scrolling: { | ||
| mode: 'standard', | ||
| useNative: false, | ||
| }, | ||
| }; | ||
|
|
||
| // T1328904 | ||
| test('columns should update auto width when expanding row', async (t) => { | ||
| const treeList = new TreeList('#container'); | ||
| await t.expect(treeList.isReady()).ok(); | ||
|
|
||
| const widthsBefore = await treeList.getHeaderCellWidths(); | ||
| const [nameWidthBefore] = widthsBefore; | ||
| await t.expect(widthsBefore).eql([250, 100, 150]); | ||
|
|
||
| const expandableCell = new ExpandableCell(treeList.getDataRow(0).getDataCell(0)); | ||
| await t.click(expandableCell.getExpandButton()); | ||
|
|
||
| const widthsAfter = await treeList.getHeaderCellWidths(); | ||
| const [nameWidthAfter, sizeWidthAfter, dateWidthAfter] = widthsAfter; | ||
| await t.expect(nameWidthAfter).gt(nameWidthBefore); | ||
| await t.expect(sizeWidthAfter).eql(100); | ||
| await t.expect(dateWidthAfter).eql(150); | ||
| }).before(async () => createWidget('dxTreeList', treeListConfig)); | ||
|
|
||
| // T1328904 | ||
| test('columns should update auto width when collapsing row', async (t) => { | ||
| const treeList = new TreeList('#container'); | ||
|
Tucchhaa marked this conversation as resolved.
|
||
| await t.expect(treeList.isReady()).ok(); | ||
|
|
||
| const widthsBefore = await treeList.getHeaderCellWidths(); | ||
| const [nameWidthBefore] = widthsBefore; | ||
|
|
||
| const expandableCell = new ExpandableCell(treeList.getDataRow(0).getDataCell(0)); | ||
| await t.click(expandableCell.getCollapseButton()); | ||
|
|
||
| const widthsAfter = await treeList.getHeaderCellWidths(); | ||
| const [nameWidthAfter, sizeWidthAfter, dateWidthAfter] = widthsAfter; | ||
| await t.expect(nameWidthAfter).lt(nameWidthBefore); | ||
| await t.expect(sizeWidthAfter).eql(100); | ||
| await t.expect(dateWidthAfter).eql(150); | ||
| }).before(async () => createWidget('dxTreeList', { | ||
| ...treeListConfig, | ||
| expandedRowKeys: [1], | ||
| })); | ||
|
|
||
| // T1328904 | ||
| test('columns should update auto width when expanded row keys are updated using API', async (t) => { | ||
| const treeList = new TreeList('#container'); | ||
|
Tucchhaa marked this conversation as resolved.
|
||
| await t.expect(treeList.isReady()).ok(); | ||
|
|
||
| const widthsBefore = await treeList.getHeaderCellWidths(); | ||
| const [nameWidthBefore] = widthsBefore; | ||
| await t.expect(widthsBefore).eql([250, 100, 150]); | ||
|
|
||
| await treeList.apiOption('expandedRowKeys', [1]); | ||
|
|
||
| const widthsAfter = await treeList.getHeaderCellWidths(); | ||
| const [nameWidthAfter, sizeWidthAfter, dateWidthAfter] = widthsAfter; | ||
| await t.expect(nameWidthAfter).gt(nameWidthBefore); | ||
| await t.expect(sizeWidthAfter).eql(100); | ||
| await t.expect(dateWidthAfter).eql(150); | ||
| }).before(async () => createWidget('dxTreeList', treeListConfig)); | ||
|
|
||
| test('columns should update auto width after loadDescendants call', async (t) => { | ||
| const treeList = new TreeList('#container'); | ||
| await t.expect(treeList.isReady()).ok(); | ||
|
|
||
| await treeList.apiLoadDescendants(1); | ||
|
|
||
| const widthsBefore = await treeList.getHeaderCellWidths(); | ||
| await t.expect(widthsBefore).eql([250, 100, 150]); | ||
|
|
||
| const expandableCell = new ExpandableCell(treeList.getDataRow(0).getDataCell(0)); | ||
| await t.click(expandableCell.getExpandButton()); | ||
|
|
||
| const widthsAfter = await treeList.getHeaderCellWidths(); | ||
| const [nameWidthAfter, sizeWidthAfter, dateWidthAfter] = widthsAfter; | ||
| await t.expect(nameWidthAfter).gt(250); | ||
| await t.expect(sizeWidthAfter).eql(100); | ||
| await t.expect(dateWidthAfter).eql(150); | ||
| }).before(async () => createWidget('dxTreeList', { | ||
| ...treeListConfig, | ||
| dataSource: { | ||
|
Tucchhaa marked this conversation as resolved.
|
||
| key: 'id', | ||
| load: ClientFunction((loadOptions: any) => { | ||
| let result = treeListData; | ||
|
|
||
| if (loadOptions.filter) { | ||
| const parentIds = loadOptions.filter[0] === 'parentId' | ||
| ? [loadOptions.filter[2]] | ||
| : loadOptions.filter | ||
| .filter((f: any) => Array.isArray(f) && f[0] === 'parentId') | ||
| .map((f: any) => f[2]); | ||
|
|
||
| if (parentIds.length) { | ||
| result = treeListData.filter((item) => parentIds.includes(item.parentId)); | ||
| } | ||
| } | ||
| return Promise.resolve(result); | ||
| }, { dependencies: { treeListData } }), | ||
| }, | ||
| remoteOperations: { | ||
| filtering: true, | ||
| }, | ||
| })); | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.