Skip to content

Commit

Permalink
Add missing tags in unit tests (#32221)
Browse files Browse the repository at this point in the history
  • Loading branch information
rohit2sharma95 committed Nov 20, 2020
1 parent 0839cbf commit 358c36d
Showing 1 changed file with 15 additions and 15 deletions.
30 changes: 15 additions & 15 deletions js/tests/unit/modal.spec.js
Expand Up @@ -338,7 +338,7 @@ describe('Modal', () => {
})

it('should set is transitioning if fade class is present', done => {
fixtureEl.innerHTML = '<div class="modal fade"><div class="modal-dialog"></div>'
fixtureEl.innerHTML = '<div class="modal fade"><div class="modal-dialog"></div></div>'

const modalEl = fixtureEl.querySelector('.modal')
const modal = new Modal(modalEl)
Expand Down Expand Up @@ -425,7 +425,7 @@ describe('Modal', () => {
})

it('should not enforce focus if focus equal to false', done => {
fixtureEl.innerHTML = '<div class="modal fade"><div class="modal-dialog"></div>'
fixtureEl.innerHTML = '<div class="modal fade"><div class="modal-dialog"></div></div>'

const modalEl = fixtureEl.querySelector('.modal')
const modal = new Modal(modalEl, {
Expand Down Expand Up @@ -542,7 +542,7 @@ describe('Modal', () => {
})

it('should not close modal when clicking outside of modal-content if backdrop = static', done => {
fixtureEl.innerHTML = '<div class="modal" data-bs-backdrop="static" ><div class="modal-dialog"></div>'
fixtureEl.innerHTML = '<div class="modal" data-bs-backdrop="static" ><div class="modal-dialog"></div></div>'

const modalEl = fixtureEl.querySelector('.modal')
const modal = new Modal(modalEl, {
Expand All @@ -569,7 +569,7 @@ describe('Modal', () => {
})

it('should close modal when escape key is pressed with keyboard = true and backdrop is static', done => {
fixtureEl.innerHTML = '<div class="modal" data-bs-backdrop="static"><div class="modal-dialog"></div>'
fixtureEl.innerHTML = '<div class="modal" data-bs-backdrop="static"><div class="modal-dialog"></div></div>'

const modalEl = fixtureEl.querySelector('.modal')
const modal = new Modal(modalEl, {
Expand Down Expand Up @@ -838,7 +838,7 @@ describe('Modal', () => {

describe('dispose', () => {
it('should dispose a modal', () => {
fixtureEl.innerHTML = '<div id="exampleModal" class="modal"><div class="modal-dialog"></div>'
fixtureEl.innerHTML = '<div id="exampleModal" class="modal"><div class="modal-dialog"></div></div>'

const modalEl = fixtureEl.querySelector('.modal')
const modal = new Modal(modalEl)
Expand All @@ -856,7 +856,7 @@ describe('Modal', () => {

describe('handleUpdate', () => {
it('should call adjust dialog', () => {
fixtureEl.innerHTML = '<div id="exampleModal" class="modal"><div class="modal-dialog"></div>'
fixtureEl.innerHTML = '<div id="exampleModal" class="modal"><div class="modal-dialog"></div></div>'

const modalEl = fixtureEl.querySelector('.modal')
const modal = new Modal(modalEl)
Expand All @@ -873,7 +873,7 @@ describe('Modal', () => {
it('should open modal', done => {
fixtureEl.innerHTML = [
'<button type="button" data-bs-toggle="modal" data-bs-target="#exampleModal"></button>',
'<div id="exampleModal" class="modal"><div class="modal-dialog"></div>'
'<div id="exampleModal" class="modal"><div class="modal-dialog"></div></div>'
].join('')

const modalEl = fixtureEl.querySelector('.modal')
Expand All @@ -894,7 +894,7 @@ describe('Modal', () => {
it('should not recreate a new modal', done => {
fixtureEl.innerHTML = [
'<button type="button" data-bs-toggle="modal" data-bs-target="#exampleModal"></button>',
'<div id="exampleModal" class="modal"><div class="modal-dialog"></div>'
'<div id="exampleModal" class="modal"><div class="modal-dialog"></div></div>'
].join('')

const modalEl = fixtureEl.querySelector('.modal')
Expand All @@ -914,7 +914,7 @@ describe('Modal', () => {
it('should prevent default when the trigger is <a> or <area>', done => {
fixtureEl.innerHTML = [
'<a data-bs-toggle="modal" href="#" data-bs-target="#exampleModal"></a>',
'<div id="exampleModal" class="modal"><div class="modal-dialog"></div>'
'<div id="exampleModal" class="modal"><div class="modal-dialog"></div></div>'
].join('')

const modalEl = fixtureEl.querySelector('.modal')
Expand All @@ -938,7 +938,7 @@ describe('Modal', () => {
it('should focus the trigger on hide', done => {
fixtureEl.innerHTML = [
'<a data-bs-toggle="modal" href="#" data-bs-target="#exampleModal"></a>',
'<div id="exampleModal" class="modal"><div class="modal-dialog"></div>'
'<div id="exampleModal" class="modal"><div class="modal-dialog"></div></div>'
].join('')

const modalEl = fixtureEl.querySelector('.modal')
Expand Down Expand Up @@ -969,7 +969,7 @@ describe('Modal', () => {
it('should not focus the trigger if the modal is not visible', done => {
fixtureEl.innerHTML = [
'<a data-bs-toggle="modal" href="#" data-bs-target="#exampleModal" style="display: none;"></a>',
'<div id="exampleModal" class="modal" style="display: none;"><div class="modal-dialog"></div>'
'<div id="exampleModal" class="modal" style="display: none;"><div class="modal-dialog"></div></div>'
].join('')

const modalEl = fixtureEl.querySelector('.modal')
Expand Down Expand Up @@ -1000,7 +1000,7 @@ describe('Modal', () => {
it('should not focus the trigger if the modal is not shown', done => {
fixtureEl.innerHTML = [
'<a data-bs-toggle="modal" href="#" data-bs-target="#exampleModal"></a>',
'<div id="exampleModal" class="modal"><div class="modal-dialog"></div>'
'<div id="exampleModal" class="modal"><div class="modal-dialog"></div></div>'
].join('')

const modalEl = fixtureEl.querySelector('.modal')
Expand Down Expand Up @@ -1068,7 +1068,7 @@ describe('Modal', () => {
}
})

it('should should call show method', () => {
it('should call show method', () => {
fixtureEl.innerHTML = '<div class="modal"><div class="modal-dialog"></div></div>'

const div = fixtureEl.querySelector('div')
Expand All @@ -1084,8 +1084,8 @@ describe('Modal', () => {
expect(modal.show).toHaveBeenCalled()
})

it('should should not call show method', () => {
fixtureEl.innerHTML = '<div class="modal" data-bs-show="false"><div class="modal-dialog"></div>'
it('should not call show method', () => {
fixtureEl.innerHTML = '<div class="modal" data-bs-show="false"><div class="modal-dialog"></div></div>'

const div = fixtureEl.querySelector('div')

Expand Down

0 comments on commit 358c36d

Please sign in to comment.