Skip to content

Commit

Permalink
chore: fix Example 19 flaky E2E test (#1304)
Browse files Browse the repository at this point in the history
  • Loading branch information
ghiscoding authored Dec 21, 2024
1 parent 1ad137e commit 24f6f69
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions packages/demo/src/examples/slickgrid/example19.ts
Original file line number Diff line number Diff line change
Expand Up @@ -220,8 +220,8 @@ export class Example19 {
const itemDetail = item;

// let's add some extra properties to our item for a better async simulation
itemDetail.assignee = randomNames[this.randomNumber(0, 10)];
itemDetail.reporter = randomNames[this.randomNumber(0, 10)];
itemDetail.assignee = randomNames[this.randomNumber(0, 9)];
itemDetail.reporter = randomNames[this.randomNumber(0, 9)];

// resolve the data after delay specified
resolve(itemDetail);
Expand Down
12 changes: 6 additions & 6 deletions test/cypress/e2e/example19.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,21 +47,21 @@ describe('Example 19 - Row Detail View', () => {
const alertStub = cy.stub();
cy.on('window:alert', alertStub);

cy.get('#grid19')
.find('.slick-cell + .dynamic-cell-detail .innerDetailView_2 .container_2')
.as('detailContainer');
cy.get('#grid19').find('.slick-cell + .dynamic-cell-detail .innerDetailView_2 .container_2').as('detailContainer');

cy.get('@detailContainer')
.find('input')
.invoke('val')
.then(text => assignee = text as string);
.then((text) => (assignee = `${text || ''}`));

cy.wait(10);

cy.get('@detailContainer')
.find('[data-test=assignee-btn]')
.click()
.then(() => {
if (assignee === '') {
expect(alertStub.getCall(0)).to.be.calledWith(`No one is assigned to this task.`);
if (!assignee) {
expect(alertStub.getCall(0)).to.be.calledWith('No one is assigned to this task.');
} else {
expect(alertStub.getCall(0)).to.be.calledWith(`Assignee on this task is: ${assignee.toUpperCase()}`);
}
Expand Down

0 comments on commit 24f6f69

Please sign in to comment.