mirror of
https://github.com/twbs/bootstrap.git
synced 2025-08-12 00:24:03 +02:00
remove underscore for static methods
This commit is contained in:
@@ -32,10 +32,10 @@ Currently we're aiming for at least 90% test coverage for our code. To ensure yo
|
||||
|
||||
```js
|
||||
// Synchronous test
|
||||
describe('_getInstance', () => {
|
||||
describe('getInstance', () => {
|
||||
it('should return null if there is no instance', () => {
|
||||
// Make assertion
|
||||
expect(Tab._getInstance(fixtureEl)).toEqual(null)
|
||||
expect(Tab.getInstance(fixtureEl)).toEqual(null)
|
||||
})
|
||||
|
||||
it('should return this instance', () => {
|
||||
@@ -45,7 +45,7 @@ describe('_getInstance', () => {
|
||||
const tab = new Tab(divEl)
|
||||
|
||||
// Make assertion
|
||||
expect(Tab._getInstance(divEl)).toEqual(tab)
|
||||
expect(Tab.getInstance(divEl)).toEqual(tab)
|
||||
})
|
||||
})
|
||||
|
||||
|
@@ -67,7 +67,7 @@
|
||||
document.getElementById('btnShowToast').addEventListener('click', function () {
|
||||
Array.from(document.querySelectorAll('.toast'))
|
||||
.forEach(function (toastNode) {
|
||||
var toast = Toast._getInstance(toastNode)
|
||||
var toast = Toast.getInstance(toastNode)
|
||||
toast.show()
|
||||
})
|
||||
})
|
||||
@@ -75,7 +75,7 @@
|
||||
document.getElementById('btnHideToast').addEventListener('click', function () {
|
||||
Array.from(document.querySelectorAll('.toast'))
|
||||
.forEach(function (toastNode) {
|
||||
var toast = Toast._getInstance(toastNode)
|
||||
var toast = Toast.getInstance(toastNode)
|
||||
toast.hide()
|
||||
})
|
||||
})
|
||||
|
Reference in New Issue
Block a user