-
Notifications
You must be signed in to change notification settings - Fork 75
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- Loading branch information
Алексей Пивкин
committed
Jun 26, 2019
1 parent
58ab99f
commit 34267e8
Showing
8 changed files
with
1,739 additions
and
676 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# Changelog | ||
|
||
## v2.1.0 (26/06/2019) | ||
|
||
#### Bug Fixes: | ||
|
||
- [#53](https://github.com/avil13/vue-sweetalert2/issues/54) Uncaught (in promise) TypeError: Cannot read property '$swal' of undefined at eval | ||
- [#55](https://github.com/avil13/vue-sweetalert2/issues/55) How to use when passing options? | ||
- [#56](https://github.com/avil13/vue-sweetalert2/issues/56) Object doesn't support property or method 'mixin' | ||
- [#57](https://github.com/avil13/vue-sweetalert2/issues/57) showLoading | ||
- [#58](https://github.com/avil13/vue-sweetalert2/issues/58) Close sweetalert | ||
|
||
#### Enhancements: | ||
|
||
- [#60](https://github.com/avil13/vue-sweetalert2/issues/60) Custom Styles not working after update | ||
|
||
--- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
import 'jest'; | ||
import { createLocalVue } from '@vue/test-utils'; | ||
import Swal from 'sweetalert2'; | ||
|
||
import VueSweetalert2 from '../src'; | ||
|
||
const factory = () => { | ||
const localVue = createLocalVue(); | ||
localVue.use(VueSweetalert2); | ||
return localVue; | ||
}; | ||
|
||
|
||
/** | ||
* Return list of all methods name in array: [ ['methodName'] ] | ||
* need for each list methods testing | ||
*/ | ||
function getAllMethodsNames(): string[][] { | ||
const keys = Object.keys(Swal); | ||
|
||
return keys | ||
.filter(name => typeof Swal[name] === 'function') | ||
.map(methodName => [methodName]); | ||
} | ||
|
||
const allMethodsNames = getAllMethodsNames(); | ||
|
||
|
||
describe('Vue-SweetAlert2 swal methods v.8.x', () => { | ||
it.skip('should fire onOpen option key', () => { | ||
const Vue = factory(); | ||
const onOpen = jest.fn(); | ||
|
||
Vue.swal({ | ||
animation: false, | ||
onOpen | ||
}); | ||
|
||
// TODO: add global window mock | ||
expect(onOpen).toBeCalled(); | ||
}); | ||
|
||
it.each(allMethodsNames)('should check methods', method => { | ||
const Vue = factory(); | ||
|
||
expect(Vue.swal[method]).toBeTruthy(); | ||
}); | ||
}); |
Oops, something went wrong.