Skip to content

Commit

Permalink
test(components): updating icon and icon slot elements in e2e tests o…
Browse files Browse the repository at this point in the history
…f card-control component
  • Loading branch information
oliverschuerch committed May 22, 2024
1 parent 31456d4 commit 9fdb8a0
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions packages/components/cypress/e2e/card-control.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ describe('Card-Control', () => {
cy.get('@card-control').find('.card-control').as('wrapper');
cy.get('@card-control').find('input.card-control--input').as('input');
cy.get('@card-control').find('label.card-control--label').as('label');
cy.get('@card-control').find('.card-control--icon').as('icon');
cy.get('@card-control').find('.card-control--icon slot[name="icon"]').as('slotIcon');
});

it('should have no console errors', () => {
Expand All @@ -26,8 +24,8 @@ describe('Card-Control', () => {

cy.get('@label').should('exist');

cy.get('@icon').should('exist');
cy.get('@slotIcon').should('exist');
cy.get('@card-control').find('.card-control--icon').should('not.exist');
cy.get('@card-control').find('.card-control--icon slot[name="icon"]').should('not.exist');
});

it('should have mandatory attributes', () => {
Expand Down Expand Up @@ -151,15 +149,19 @@ describe('Card-Control', () => {
});

it('should set icon "name" attr according to "icon" prop', () => {
cy.get('@slotIcon').find('post-icon').should('not.exist');
cy.get('@card-control').invoke('attr', 'icon', '1000');
cy.get('@slotIcon')
.find('post-icon')
cy.get('@card-control')
.find('.card-control--icon slot[name="icon"] post-icon')
.should('not.exist');
cy.get('@card-control')
.invoke('attr', 'icon', '1000')
.find('.card-control--icon slot[name="icon"] post-icon')
.should('exist')
.find('[style*="/1000.svg"]')
.should('exist');
cy.get('@card-control').invoke('removeAttr', 'icon');
cy.get('@slotIcon').find('post-icon').should('not.exist');
cy.get('@card-control')
.invoke('removeAttr', 'icon')
.find('.card-control--icon slot[name="icon"] post-icon')
.should('not.exist');
});
});

Expand Down Expand Up @@ -306,8 +308,6 @@ describe('Card-Control', () => {
cy.get('@card-control').find('.card-control').as('wrapper');
cy.get('@card-control').find('input.card-control--input').as('input');
cy.get('@card-control').find('label.card-control--label').as('label');
cy.get('@card-control').find('.card-control--icon').as('icon');
cy.get('@card-control').find('.card-control--icon slot[name="icon"]').as('slotIcon');
});
it('should update surrounding form when toggled', () => {
cy.get('@form').then($form => {
Expand Down

0 comments on commit 9fdb8a0

Please sign in to comment.