Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 43 additions & 0 deletions packages/grid/test/column.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -503,6 +503,49 @@
});
});

describe('cell content attach and detach', () => {
it('should remove header cell content from the grid when column is removed', async () => {

Check failure on line 507 in packages/grid/test/column.test.js

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Add at least one assertion to this test case.

See more on https://sonarcloud.io/project/issues?id=vaadin_web-components&issues=AZ9wLfFUgA5MgWOuwvmv&open=AZ9wLfFUgA5MgWOuwvmv&pullRequest=12181
Comment thread
vursen marked this conversation as resolved.
Outdated
const content = getHeaderCellContent(grid, 1, 0);

column.remove();
await nextFrame();

expect(content.parentElement).to.be.null;
});

it('should remove footer cell content from the grid when column is removed', async () => {

Check failure on line 516 in packages/grid/test/column.test.js

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Add at least one assertion to this test case.

See more on https://sonarcloud.io/project/issues?id=vaadin_web-components&issues=AZ9wLfFUgA5MgWOuwvmw&open=AZ9wLfFUgA5MgWOuwvmw&pullRequest=12181
const content = getContainerCellContent(grid.$.footer, 0, 0);

column.remove();
await nextFrame();

expect(content.parentElement).to.be.null;
});

it('should remove body cell content from the grid when column is removed', async () => {

Check failure on line 525 in packages/grid/test/column.test.js

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Add at least one assertion to this test case.

See more on https://sonarcloud.io/project/issues?id=vaadin_web-components&issues=AZ9wLfFUgA5MgWOuwvmx&open=AZ9wLfFUgA5MgWOuwvmx&pullRequest=12181
const content = getBodyCellContent(grid, 0, 0);

column.remove();
await nextFrame();

expect(content.parentElement).to.be.null;
});

it('should render cell content when column is added back', async () => {
const group = column.parentElement;
column.remove();
await nextFrame();

group.insertBefore(column, group.firstElementChild);
await nextFrame();
flushGrid(grid);

expect(getHeaderCellContent(grid, 1, 0).textContent).to.equal('header1');
expect(getContainerCellContent(grid.$.footer, 0, 0).textContent).to.equal('footer1');
expect(getBodyCellContent(grid, 0, 0).textContent).to.equal('cell');
});
});

it('should not throw an exception when size is changed after removing column', () => {
expect(grid.size).to.equal(10);
expect(column.isConnected).to.be.true;
Expand Down
Loading