Skip to content

Commit 67b26cf

Browse files
committed
Tests - UserOptions - Update component test
1 parent 901798d commit 67b26cf

File tree

1 file changed

+15
-3
lines changed

1 file changed

+15
-3
lines changed

src/atoms/UserOptions.cy.js

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@ describe('<UserOptions />', () => {
1414
hasSort: true,
1515
hasFullscreen: true,
1616
hasAnimation: true,
17-
hasAnnotator: true
17+
hasAnnotator: true,
18+
hasSvg: true
1819
}
1920
});
2021
}
@@ -55,7 +56,8 @@ describe('<UserOptions />', () => {
5556
'user-options-sort',
5657
'user-options-fullscreen',
5758
'user-options-anim',
58-
'user-options-annotator'
59+
'user-options-annotator',
60+
'user-options-svg'
5961
].forEach(btn => {
6062
cy.get(`[data-cy="${btn}"]`).should('exist').and('be.visible');
6163
})
@@ -74,6 +76,7 @@ describe('<UserOptions />', () => {
7476
hasAnimation: true,
7577
hasAnnotator: true,
7678
hasFullscreen: true,
79+
hasSvg: true,
7780
chartElement: {
7881
requestFullscreen: () => {},
7982
exitFullscreen: () => {}
@@ -116,6 +119,9 @@ describe('<UserOptions />', () => {
116119
cy.get('[data-cy="user-options-annotator"]').click().then(() => {
117120
expect(wrapper.emitted('toggleAnnotator')).to.exist
118121
})
122+
cy.get('[data-cy="user-options-svg"]').click().then(() => {
123+
expect(wrapper.emitted('generateSvg')).to.exist
124+
})
119125
})
120126
})
121127

@@ -133,6 +139,7 @@ describe('<UserOptions />', () => {
133139
hasAnimation: true,
134140
hasAnnotator: true,
135141
hasFullscreen: true,
142+
hasSvg: true,
136143
titles: {
137144
open: 'open',
138145
close: 'close',
@@ -146,7 +153,8 @@ describe('<UserOptions />', () => {
146153
stack: 'stack',
147154
fullscreen: 'fullscreen',
148155
animation: 'animation',
149-
annotator: 'annotator'
156+
annotator: 'annotator',
157+
svg: 'svg'
150158
}
151159
}
152160
}).then(() => {
@@ -195,6 +203,10 @@ describe('<UserOptions />', () => {
195203
cy.get('[data-cy="uo-tooltip"]').should('be.visible').and('contain', 'annotator')
196204
cy.get('[data-cy="user-options-annotator"]').trigger('mouseout')
197205
})
206+
cy.get('[data-cy="user-options-svg"]').trigger('mouseenter').then(() => {
207+
cy.get('[data-cy="uo-tooltip"]').should('be.visible').and('contain', 'svg')
208+
cy.get('[data-cy="user-options-svg"]').trigger('mouseout')
209+
})
198210
})
199211
})
200212
})

0 commit comments

Comments
 (0)