Skip to content

Commit 34a3ac9

Browse files
committed
Tests - Improve VueUiGalaxy component test
1 parent 0cf0098 commit 34a3ac9

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

src/components/vue-ui-galaxy.cy.js

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,4 +32,35 @@ describe('<VueUiGalaxy />', () => {
3232
cy.get('[data-cy="datapoint-path"]').should('exist').and('be.visible').and('have.length', dataset.length);
3333
});
3434
});
35+
36+
it('emits', () => {
37+
cy.mount(VueUiGalaxy, {
38+
props: {
39+
config,
40+
dataset
41+
}
42+
}).then(({ wrapper }) => {
43+
cy.log('@selectLegend');
44+
cy.get('[data-cy="legend-item-0"]').click({ force: true }).then(() => {
45+
expect(wrapper.emitted('selectLegend')).to.exist;
46+
})
47+
48+
cy.log('@selectDatapoint');
49+
cy.get('[data-cy="tooltip-trap"]').first().click({ force: true }).then(() => {
50+
expect(wrapper.emitted('selectDatapoint')).to.exist;
51+
expect(wrapper.emitted('selectDatapoint')[0][0]).to.have.keys(
52+
'absoluteValues',
53+
'color',
54+
'id',
55+
'name',
56+
'path',
57+
'points',
58+
'proportion',
59+
'seriesIndex',
60+
'value'
61+
);
62+
expect(wrapper.emitted('selectDatapoint')[0][0].seriesIndex).to.equal(1);
63+
});
64+
});
65+
});
3566
});

0 commit comments

Comments
 (0)