mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2026-03-13 10:22:08 +08:00
test(ionicView): update
This commit is contained in:
8
js/ext/angular/src/service/ionicModal.js
vendored
8
js/ext/angular/src/service/ionicModal.js
vendored
@@ -203,12 +203,12 @@ angular.module('ionic.service.modal', ['ionic.service.templateLoad', 'ionic.serv
|
||||
* @returns {promise} A promise that will be resolved with an instance of
|
||||
* an {@link ionic.controller:ionicModal} controller.
|
||||
*/
|
||||
fromTemplateUrl: function(url, options) {
|
||||
fromTemplateUrl: function(url, options, _) {
|
||||
var cb;
|
||||
//Deprecated: allow a callback as second parameter. Now we return a promise.
|
||||
if (arguments.length === 3) {
|
||||
cb = arguments[1];
|
||||
options = arguments[2] || {};
|
||||
if (angular.isFunction(options)) {
|
||||
cb = options;
|
||||
options = _;
|
||||
}
|
||||
return $ionicTemplateLoader.load(url).then(function(templateString) {
|
||||
var modal = createModal(templateString, options || {});
|
||||
|
||||
@@ -23,11 +23,11 @@ describe('Ionic View', function() {
|
||||
|
||||
it('should broacast view enter on link', function() {
|
||||
spyOn(scope, '$broadcast');
|
||||
var element = compile('<ion-view title="\'Me Title\'"></ion-view>')(scope);
|
||||
var element = compile('<ion-view title="Me Title"></ion-view>')(scope);
|
||||
expect(scope.$broadcast).toHaveBeenCalledWith('viewState.viewEnter', { title: 'Me Title', navDirection: undefined });
|
||||
|
||||
scope.$navDirection = 'forward';
|
||||
element = compile('<ion-view title="\'Me Title\'"></ion-view>')(scope);
|
||||
element = compile('<ion-view title="Me Title"></ion-view>')(scope);
|
||||
expect(scope.$broadcast).toHaveBeenCalledWith('viewState.viewEnter', { title: 'Me Title', navDirection: 'forward' });
|
||||
});
|
||||
|
||||
@@ -109,7 +109,7 @@ describe('Ionic View', function() {
|
||||
|
||||
it('should show and update navBar title when using view attr or events', function() {
|
||||
scope.viewTitle = 'Title';
|
||||
var element = compile('<div><ion-nav-bar></ion-nav-bar><ion-view title="viewTitle"></ion-view></div>')(scope);
|
||||
var element = compile('<div><ion-nav-bar></ion-nav-bar><ion-view title="{{viewTitle}}"></ion-view></div>')(scope);
|
||||
scope.$digest();
|
||||
var navBar = element.find('header');
|
||||
var title = navBar.find('h1');
|
||||
|
||||
Reference in New Issue
Block a user