Skip to content

Commit e60d5c1

Browse files
committed
Tests - Update Slicer & Tooltip component tests
1 parent 1bf16ed commit e60d5c1

File tree

2 files changed

+13
-12
lines changed

2 files changed

+13
-12
lines changed

src/atoms/Slicer.cy.js

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -130,10 +130,10 @@ describe("<Slicer />", () => {
130130
.trigger('mousedown', { force: true })
131131
.trigger('mousemove', {force: true, clientX: 400 })
132132

133-
cy.wrap(slicer).should('have.property', 'start', 3);
134-
cy.wrap(slicer).should('have.property', 'end', 11);
135-
cy.get('[data-cy="slicer-label-left"]').as('left').should('exist').and('be.visible').and('contain', '____ 3 ____')
136-
cy.get('[data-cy="slicer-label-right"]').as('right').should('exist').and('be.visible').and('contain', '____ 10 ____')
133+
cy.wrap(slicer).should('have.property', 'start', 12);
134+
cy.wrap(slicer).should('have.property', 'end', 20);
135+
cy.get('[data-cy="slicer-label-left"]').as('left').should('exist').and('be.visible').and('contain', '____ 12 ____')
136+
cy.get('[data-cy="slicer-label-right"]').as('right').should('exist').and('be.visible').and('contain', '____ 19 ____')
137137
})
138138
})
139139

@@ -153,10 +153,10 @@ describe("<Slicer />", () => {
153153
.trigger('mousedown', { force: true })
154154
.trigger('mousemove', {force: true, clientX: 400 })
155155

156-
cy.wrap(slicer).should('have.property', 'start', 3);
157-
cy.wrap(slicer).should('have.property', 'end', 11);
158-
cy.get('[data-cy="slicer-label-left"]').as('left').should('exist').and('be.visible').and('contain', '____ 3 ____')
159-
cy.get('[data-cy="slicer-label-right"]').as('right').should('exist').and('be.visible').and('contain', '____ 10 ____')
156+
cy.wrap(slicer).should('have.property', 'start', 12);
157+
cy.wrap(slicer).should('have.property', 'end', 20);
158+
cy.get('[data-cy="slicer-label-left"]').as('left').should('exist').and('be.visible').and('contain', '____ 12 ____')
159+
cy.get('[data-cy="slicer-label-right"]').as('right').should('exist').and('be.visible').and('contain', '____ 19 ____')
160160
})
161161
})
162162

@@ -175,7 +175,7 @@ describe("<Slicer />", () => {
175175
.trigger('mousedown', { force: true })
176176
.trigger('mousemove', {force: true, clientX: 400 })
177177

178-
cy.get('[data-cy="slicer-label-merged"]').should('be.visible').and('contain', '____ 3 ____')
178+
cy.get('[data-cy="slicer-label-merged"]').should('be.visible').and('contain', '____ 17 ____')
179179
cy.get('[data-cy="slicer-label-left"]').should('not.be.visible')
180180
cy.get('[data-cy="slicer-label-right"]').should('not.be.visible')
181181
})
@@ -196,7 +196,7 @@ describe("<Slicer />", () => {
196196
.trigger('mousedown', { force: true })
197197
.trigger('mousemove', {force: true, clientX: 400 })
198198

199-
cy.get('[data-cy="slicer-label-merged"]').should('be.visible').and('contain', '____ 3 ____ - ____ 4 ____');
199+
cy.get('[data-cy="slicer-label-merged"]').should('be.visible').and('contain', '____ 16 ____ - ____ 17 ____');
200200
cy.get('[data-cy="slicer-label-left"]').should('not.be.visible')
201201
cy.get('[data-cy="slicer-label-right"]').should('not.be.visible')
202202
})

src/atoms/Tooltip.cy.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,8 @@ describe('<Tooltip />', () => {
3333

3434
it('follows the mouse', () => {
3535
cy.get('body').trigger('mousemove', { clientX: 200, clientY: 200, force: true})
36-
cy.get('[data-cy="tooltip"]').should('have.css', 'top', '224px')
37-
cy.get('[data-cy="tooltip"]').should('have.css', 'left', '200px')
36+
cy.get('[data-cy="tooltip"]').should('have.css', 'top', '0px')
37+
cy.get('[data-cy="tooltip"]').should('have.css', 'left', '0px')
38+
cy.get('[data-cy="tooltip"]').should('have.css', 'transform', 'matrix(1, 0, 0, 1, 200, 224)')
3839
})
3940
})

0 commit comments

Comments
 (0)