Skip to content
This repository has been archived by the owner on Nov 6, 2023. It is now read-only.

Commit

Permalink
Add WYSIWIG for another case of camouflaged buttons/links
Browse files Browse the repository at this point in the history
  • Loading branch information
Tony Spataro committed Feb 24, 2023
1 parent 106b458 commit cdecb25
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 8 deletions.
21 changes: 15 additions & 6 deletions cypress/component/components.cy.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,21 @@ describe('components', () => {
cy.component(comp.BlockPanel, 'other label').should('not.exist');
});

it('Button', () => {
cy.mount(<Button>some label</Button>);
cy.component(comp.Button).should('be.visible');
cy.component(comp.Button, 'some label');
cy.component(comp.Button, 'other label').should('not.exist');
});
context('Button', () => {
it('vanilla HTML', () => {
cy.mount(<Button>some label</Button>);
cy.component(comp.Button).should('be.visible');
cy.component(comp.Button, 'some label');
cy.component(comp.Button, 'other label').should('not.exist');
});

it('button-styled link', () => {
cy.mount(<a className="btn btn-secondary">some label</a>);
cy.component(comp.Button).should('be.visible');
cy.component(comp.Button, 'some label');
cy.component(comp.Button, 'other label').should('not.exist');
})
})

it('Card', () => {
cy.mount(
Expand Down
4 changes: 2 additions & 2 deletions src/components.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ export const BlockPanel: ComponentWithText = {

export const Button: ComponentWithText = {
name: 'Button',
query: 'button',
textQuery: 'button',
query: 'button,a.btn',
textQuery: 'button,a.btn',
};

export const Card: ComponentWithText = {
Expand Down

0 comments on commit cdecb25

Please sign in to comment.