From 2b945055042d0a1a24b48dc37fdde4bab5f35c75 Mon Sep 17 00:00:00 2001 From: ghiscoding Date: Fri, 20 Dec 2024 22:30:22 -0500 Subject: [PATCH 1/5] chore: fix Example 19 flaky E2E test --- src/app/examples/grid-rowdetail.component.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/app/examples/grid-rowdetail.component.ts b/src/app/examples/grid-rowdetail.component.ts index f2187c4c7..4ab20a540 100644 --- a/src/app/examples/grid-rowdetail.component.ts +++ b/src/app/examples/grid-rowdetail.component.ts @@ -292,8 +292,8 @@ export class GridRowDetailComponent implements OnDestroy, OnInit { 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); From c4514de09d220ba9d126af5f704d7a1e1d57835c Mon Sep 17 00:00:00 2001 From: ghiscoding Date: Fri, 20 Dec 2024 22:37:20 -0500 Subject: [PATCH 2/5] chore: fix Example 19 flaky E2E test --- test/cypress/e2e/example21.cy.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/test/cypress/e2e/example21.cy.ts b/test/cypress/e2e/example21.cy.ts index 9b538e33c..3ab202590 100644 --- a/test/cypress/e2e/example21.cy.ts +++ b/test/cypress/e2e/example21.cy.ts @@ -44,14 +44,16 @@ describe('Example 21 - Row Detail View', () => { 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()}`); } From 7224d72fb18ba524dda34c35db3a558b18e76ead Mon Sep 17 00:00:00 2001 From: ghiscoding Date: Fri, 20 Dec 2024 22:44:17 -0500 Subject: [PATCH 3/5] chore: fix Example 21 flaky E2E test --- src/app/examples/grid-rowdetail.component.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/app/examples/grid-rowdetail.component.ts b/src/app/examples/grid-rowdetail.component.ts index 4ab20a540..1232b1efc 100644 --- a/src/app/examples/grid-rowdetail.component.ts +++ b/src/app/examples/grid-rowdetail.component.ts @@ -292,8 +292,8 @@ export class GridRowDetailComponent implements OnDestroy, OnInit { const itemDetail = item; // let's add some extra properties to our item for a better async simulation - itemDetail.assignee = randomNames[this.randomNumber(0, 9)]; - itemDetail.reporter = randomNames[this.randomNumber(0, 9)]; + itemDetail.assignee = randomNames[this.randomNumber(0, 9)] || ''; + itemDetail.reporter = randomNames[this.randomNumber(0, 9)] || ''; // resolve the data after delay specified resolve(itemDetail); From e16d7a5f9bd9cd277d60719ac85ada51be7f1c43 Mon Sep 17 00:00:00 2001 From: ghiscoding Date: Fri, 20 Dec 2024 22:46:31 -0500 Subject: [PATCH 4/5] chore: fix Example 21 flaky E2E test --- test/cypress/e2e/example21.cy.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/cypress/e2e/example21.cy.ts b/test/cypress/e2e/example21.cy.ts index 3ab202590..80b7e2753 100644 --- a/test/cypress/e2e/example21.cy.ts +++ b/test/cypress/e2e/example21.cy.ts @@ -52,7 +52,7 @@ describe('Example 21 - Row Detail View', () => { .find('[data-test=assignee-btn]') .click() .then(() => { - if (!assignee) { + if (typeof assignee !== 'string') { 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()}`); From fde2be444a4ec0b13be6c680df67c64cfe12530a Mon Sep 17 00:00:00 2001 From: ghiscoding Date: Fri, 20 Dec 2024 22:47:15 -0500 Subject: [PATCH 5/5] chore: fix Example 21 flaky E2E test --- test/cypress/e2e/example21.cy.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/cypress/e2e/example21.cy.ts b/test/cypress/e2e/example21.cy.ts index 80b7e2753..d44f04254 100644 --- a/test/cypress/e2e/example21.cy.ts +++ b/test/cypress/e2e/example21.cy.ts @@ -52,7 +52,7 @@ describe('Example 21 - Row Detail View', () => { .find('[data-test=assignee-btn]') .click() .then(() => { - if (typeof assignee !== 'string') { + 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()}`);