1
0
mirror of https://github.com/twbs/bootstrap.git synced 2025-08-16 18:44:01 +02:00

Add bs in data attributes

- Add `bs` in data APIs everywhere
- Update unit tests
This commit is contained in:
Rohit Sharma
2020-07-22 22:33:11 +03:00
committed by XhmikosR
parent fe961c192d
commit 418f17ee2b
76 changed files with 827 additions and 807 deletions

View File

@@ -43,10 +43,10 @@ describe('Toast', () => {
toast.show()
})
it('should close toast when close element with data-dismiss attribute is set', done => {
it('should close toast when close element with data-bs-dismiss attribute is set', done => {
fixtureEl.innerHTML = [
'<div class="toast" data-delay="1" data-autohide="false" data-animation="false">',
' <button type="button" class="ml-2 mb-1 close" data-dismiss="toast">',
'<div class="toast" data-bs-delay="1" data-bs-autohide="false" data-bs-animation="false">',
' <button type="button" class="ml-2 mb-1 close" data-bs-dismiss="toast">',
' close',
' </button>',
'</div>'
@@ -79,8 +79,8 @@ describe('Toast', () => {
Toast.Default.delay = defaultDelay
fixtureEl.innerHTML = [
'<div class="toast" data-autohide="false" data-animation="false">',
' <button type="button" class="ml-2 mb-1 close" data-dismiss="toast">',
'<div class="toast" data-bs-autohide="false" data-bs-animation="false">',
' <button type="button" class="ml-2 mb-1 close" data-bs-dismiss="toast">',
' close',
' </button>',
'</div>'
@@ -102,7 +102,7 @@ describe('Toast', () => {
describe('show', () => {
it('should auto hide', done => {
fixtureEl.innerHTML = [
'<div class="toast" data-delay="1">',
'<div class="toast" data-bs-delay="1">',
' <div class="toast-body">',
' a simple toast',
' </div>',
@@ -122,7 +122,7 @@ describe('Toast', () => {
it('should not add fade class', done => {
fixtureEl.innerHTML = [
'<div class="toast" data-delay="1" data-animation="false">',
'<div class="toast" data-bs-delay="1" data-bs-animation="false">',
' <div class="toast-body">',
' a simple toast',
' </div>',
@@ -142,7 +142,7 @@ describe('Toast', () => {
it('should not trigger shown if show is prevented', done => {
fixtureEl.innerHTML = [
'<div class="toast" data-delay="1" data-animation="false">',
'<div class="toast" data-bs-delay="1" data-bs-animation="false">',
' <div class="toast-body">',
' a simple toast',
' </div>',
@@ -202,7 +202,7 @@ describe('Toast', () => {
describe('hide', () => {
it('should allow to hide toast manually', done => {
fixtureEl.innerHTML = [
'<div class="toast" data-delay="1" data-autohide="false">',
'<div class="toast" data-bs-delay="1" data-bs-autohide="false">',
' <div class="toast-body">',
' a simple toast',
' </div>',
@@ -239,7 +239,7 @@ describe('Toast', () => {
it('should not trigger hidden if hide is prevented', done => {
fixtureEl.innerHTML = [
'<div class="toast" data-delay="1" data-animation="false">',
'<div class="toast" data-bs-delay="1" data-bs-animation="false">',
' <div class="toast-body">',
' a simple toast',
' </div>',
@@ -289,7 +289,7 @@ describe('Toast', () => {
it('should allow to destroy toast and hide it before that', done => {
fixtureEl.innerHTML = [
'<div class="toast" data-delay="0" data-autohide="false">',
'<div class="toast" data-bs-delay="0" data-bs-autohide="false">',
' <div class="toast-body">',
' a simple toast',
' </div>',