From a9b58c204ddc605b3d7385f8bd2d997fb9378727 Mon Sep 17 00:00:00 2001 From: splincode Date: Tue, 13 Feb 2024 13:12:46 +0300 Subject: [PATCH] chore: flaky again --- projects/demo-cypress/src/tests/elastic-sticky.cy.ts | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/projects/demo-cypress/src/tests/elastic-sticky.cy.ts b/projects/demo-cypress/src/tests/elastic-sticky.cy.ts index fd78bbbacdca..fb99e818e437 100644 --- a/projects/demo-cypress/src/tests/elastic-sticky.cy.ts +++ b/projects/demo-cypress/src/tests/elastic-sticky.cy.ts @@ -15,7 +15,7 @@ describe('ElasticSticky', () => {
I'm header
I'm sticky
@@ -27,6 +27,11 @@ describe('ElasticSticky', () => { class TestComponent { @Output() change = new EventEmitter(); + + transform(value: number): number { + // sometimes tuiElasticSticky emit 0.5, 0.52 or 0.53 on CI + return Number(value.toFixed(1)); + } } beforeEach(() => @@ -40,11 +45,11 @@ describe('ElasticSticky', () => { it('callback is triggered with 0.5 when half of sticky would be hidden', () => { cy.get('#scroll').scrollTo(0, 75); - cy.get('@changeSpy').should('be.called').should('have.been.calledWithMatch', 0.5); + cy.get('@changeSpy').should('be.called').should('have.been.calledWith', 0.5); }); it('callback is triggered with 0 when sticky is fully hidden', () => { cy.get('#scroll').scrollTo(0, 100); - cy.get('@changeSpy').should('be.called').should('have.been.calledWithMatch', 0); + cy.get('@changeSpy').should('be.called').should('have.been.calledWith', 0); }); });