Skip to content

Instantly share code, notes, and snippets.

@kcmr
Created June 17, 2018 21:20
Show Gist options
  • Save kcmr/ae62dd068faf60b79e7fc79bdf15e98d to your computer and use it in GitHub Desktop.
Save kcmr/ae62dd068faf60b79e7fc79bdf15e98d to your computer and use it in GitHub Desktop.
describe('<my-modal>', () => {
// context es un alias de describe
context('setting "opened" as true', () => {
// fixture instancia el componente
const sut = fixture('someId');
// Se ejecuta una vez antes de todos los tests de este bloque
before(() => {
sut.opened = true;
});
it('opens the modal', () => {
expect(isVisible(sut)).to.be.true;
});
it('sets "aria-hidden" attribute to false', () => {
expect(sut.getAttribute('aria-hidden')).to.equal('false');
});
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment