Skip to content

Commit

Permalink
test: round values
Browse files Browse the repository at this point in the history
  • Loading branch information
Lukas742 committed Jun 18, 2024
1 parent c254ce3 commit b0a70f2
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions packages/main/src/internal/utils.cy.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -114,39 +114,39 @@ describe('utils', function () {
cy.findByText('Sticky Header')
.as('sticky1')
.should(($el) => {
expect($el[0].getBoundingClientRect().top).to.eq(216);
expect(Math.floor($el[0].getBoundingClientRect().top)).to.eq(216);
});
cy.findByText('Content1')
.as('content1')
.should(($el) => {
expect($el[0].getBoundingClientRect().top).to.eq(280);
expect(Math.floor($el[0].getBoundingClientRect().top)).to.eq(280);
});
cy.findByText('Sticky Header 2')
.as('sticky2')
.should(($el) => {
expect($el[0].getBoundingClientRect().top).to.eq(520);
expect(Math.floor($el[0].getBoundingClientRect().top)).to.eq(520);
});
cy.findByText('End Content')
.as('endContent')
.should(($el) => {
expect($el[0].getBoundingClientRect().top).to.eq(2648);
expect(Math.floor($el[0].getBoundingClientRect().top)).to.eq(2648);
});

cy.get('.ui5-dynamic-page-scroll-container').scrollTo('bottom');
cy.wait(50);
cy.get('.ui5-dynamic-page-scroll-container').scrollTo('bottom');

cy.get('@sticky1').should(($el) => {
expect($el[0].getBoundingClientRect().top).to.eq(88);
expect(Math.floor($el[0].getBoundingClientRect().top)).to.eq(88);
});
cy.get('@content1').should(($el) => {
expect($el[0].getBoundingClientRect().top).to.eq(-1842.5);
expect(Math.floor($el[0].getBoundingClientRect().top)).to.eq(-1842);
});
cy.get('@sticky2').should(($el) => {
expect($el[0].getBoundingClientRect().top).to.eq(152);
expect(Math.floor($el[0].getBoundingClientRect().top)).to.eq(152);
});
cy.get('@endContent').should(($el) => {
expect($el[0].getBoundingClientRect().top).to.eq(525.5);
expect(Math.floor($el[0].getBoundingClientRect().top)).to.eq(525);
});
});
});
Expand Down

0 comments on commit b0a70f2

Please sign in to comment.