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); }); });