})
describe('show', () => {
- it('if it is "shown", should append the backdrop html once, on show, and contain "show" class', done => {
+ it('should append the backdrop html once on show and include the "show" class if it is "shown"', done => {
const instance = new Backdrop({
isVisible: true,
isAnimated: false
})
})
- it('if it is not "shown", should not append the backdrop html', done => {
+ it('should not append the backdrop html if it is not "shown"', done => {
const instance = new Backdrop({
isVisible: false,
isAnimated: true
})
})
- it('if it is "shown" and "animated", should append the backdrop html once, and contain "fade" class', done => {
+ it('should append the backdrop html once and include the "fade" class if it is "shown" and "animated"', done => {
const instance = new Backdrop({
isVisible: true,
isAnimated: true
})
})
- it('should remove "show" class', done => {
+ it('should remove the "show" class', done => {
const instance = new Backdrop({
isVisible: true,
isAnimated: true
})
})
- it('if it is not "shown", should not try to remove Node on remove method', done => {
+ it('should not try to remove Node on remove method if it is not "shown"', done => {
const instance = new Backdrop({
isVisible: false,
isAnimated: true
})
describe('click callback', () => {
- it('it should execute callback on click', done => {
+ it('should execute callback on click', done => {
const spy = jasmine.createSpy('spy')
const instance = new Backdrop({
})
describe('animation callbacks', () => {
- it('if it is animated, should show and hide backdrop after counting transition duration', done => {
+ it('should show and hide backdrop after counting transition duration if it is animated', done => {
const instance = new Backdrop({
isVisible: true,
isAnimated: true
expect(spy2).not.toHaveBeenCalled()
})
- it('if it is not animated, should show and hide backdrop without delay', done => {
+ it('should show and hide backdrop without a delay if it is not animated', done => {
const spy = jasmine.createSpy('spy', getTransitionDurationFromElement)
const instance = new Backdrop({
isVisible: true,
}, 10)
})
- it('if it is not "shown", should not call delay callbacks', done => {
+ it('should not call delay callbacks if it is not "shown"', done => {
const instance = new Backdrop({
isVisible: false,
isAnimated: true
describe('Config', () => {
describe('rootElement initialization', () => {
- it('Should be appended on "document.body" by default', done => {
+ it('should be appended on "document.body" by default', done => {
const instance = new Backdrop({
isVisible: true
})
})
})
- it('Should find the rootElement if passed as a string', done => {
+ it('should find the rootElement if passed as a string', done => {
const instance = new Backdrop({
isVisible: true,
rootElement: 'body'
})
})
- it('Should appended on any element given by the proper config', done => {
+ it('should be appended on any element given by the proper config', done => {
fixtureEl.innerHTML = '<div id="wrapper"></div>'
const wrapper = fixtureEl.querySelector('#wrapper')
})
describe('ClassName', () => {
- it('Should be able to have different classNames than default', done => {
+ it('should allow configuring className', done => {
const instance = new Backdrop({
isVisible: true,
className: 'foo'