Skip to content

Commit

Permalink
Do not deprecate visibleColumns
Browse files Browse the repository at this point in the history
  • Loading branch information
jperals committed Apr 24, 2023
1 parent 77bcce6 commit ea9f506
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 24 deletions.
File renamed without changes.
44 changes: 22 additions & 22 deletions src/table/__integ__/preferences-integration.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,28 @@ test(
})
);
test(
'changes column visibility',
'changes column visibility using the visibleColumn property',
useBrowser(async browser => {
await browser.url('#/light/table/visible-content');
const page = new BasePageObject(browser);
await page.waitForVisible(wrapper.findRows().toSelector());
await expect(
page.getElementsText(wrapper.findColumnHeaders().find(`.${headerCellStyles['header-cell-content']}`).toSelector())
).resolves.toEqual(['ID', 'Type', 'DNS name', 'State']);

await page.click(preferences.findTriggerButton().toSelector());
await page.waitForVisible(preferences.findModal().toSelector());
await page.click(preferences.findModal().findVisibleContentPreference().findToggleByIndex(1, 2).toSelector());
await page.click(preferences.findModal().findVisibleContentPreference().findToggleByIndex(1, 3).toSelector());
await page.click(preferences.findModal().findVisibleContentPreference().findToggleByIndex(1, 4).toSelector());
await page.click(preferences.findModal().findConfirmButton().toSelector());
await expect(
page.getElementsText(wrapper.findColumnHeaders().find(`.${headerCellStyles['header-cell-content']}`).toSelector())
).resolves.toEqual(['ID', 'Image ID', 'State']);
})
);
test(
'changes column visibility using the columnDisplay property',
useBrowser(async browser => {
await browser.url('#/light/table/hooks');
const page = new BasePageObject(browser);
Expand Down Expand Up @@ -90,24 +111,3 @@ test(
).resolves.toEqual(['ID', 'DNS name', 'Type', 'State']);
})
);
test(
'changes visible columns using the deprecated Visible Column preference',
useBrowser(async browser => {
await browser.url('#/light/table/deprecated.visible-content');
const page = new BasePageObject(browser);
await page.waitForVisible(wrapper.findRows().toSelector());
await expect(
page.getElementsText(wrapper.findColumnHeaders().find(`.${headerCellStyles['header-cell-content']}`).toSelector())
).resolves.toEqual(['ID', 'Type', 'DNS name', 'State']);

await page.click(preferences.findTriggerButton().toSelector());
await page.waitForVisible(preferences.findModal().toSelector());
await page.click(preferences.findModal().findVisibleContentPreference().findToggleByIndex(1, 2).toSelector());
await page.click(preferences.findModal().findVisibleContentPreference().findToggleByIndex(1, 3).toSelector());
await page.click(preferences.findModal().findVisibleContentPreference().findToggleByIndex(1, 4).toSelector());
await page.click(preferences.findModal().findConfirmButton().toSelector());
await expect(
page.getElementsText(wrapper.findColumnHeaders().find(`.${headerCellStyles['header-cell-content']}`).toSelector())
).resolves.toEqual(['ID', 'Image ID', 'State']);
})
);
2 changes: 0 additions & 2 deletions src/table/interfaces.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -206,8 +206,6 @@ export interface TableProps<T = any> extends BaseComponentProps {
* Use it in conjunction with the visible content preference of the [collection preferences](/components/collection-preferences/) component.
*
* The order of ids doesn't influence the order in which columns are displayed - this is dictated by the `columnDefinitions` property.
*
* @deprecated Use the `columnDisplay` property instead.
* */
visibleColumns?: ReadonlyArray<string>;

Expand Down

0 comments on commit ea9f506

Please sign in to comment.