From 48ca80d2e508cf17469e7614280724c82170959f Mon Sep 17 00:00:00 2001 From: Igor Rafael Date: Sun, 24 Sep 2017 11:18:33 -0300 Subject: [PATCH] fix(uiCreditCardMask): rename "uiCreditCard" to "uiCreditCardMask" BREAKING CHANGE the "ui-credit-card" mask was renamed to "ui-credit-card-mask" --- src/global/credit-card/credit-card.html | 6 +++--- src/global/credit-card/credit-card.spec.js | 2 +- src/global/credit-card/credit-card.test.js | 15 +++++++-------- src/global/global-masks.js | 2 +- 4 files changed, 12 insertions(+), 13 deletions(-) diff --git a/src/global/credit-card/credit-card.html b/src/global/credit-card/credit-card.html index fa4d581c..6c60e152 100644 --- a/src/global/credit-card/credit-card.html +++ b/src/global/credit-card/credit-card.html @@ -16,13 +16,13 @@

ui-br-phone-number

-
+
- - {{form.freeLinePhoneNumber.$error}}

-
+
- - {{form.creditCard.$error}}

-
+
- - {{form.initializedCC.$error}}
diff --git a/src/global/credit-card/credit-card.spec.js b/src/global/credit-card/credit-card.spec.js index 00455a4a..a8b46b72 100644 --- a/src/global/credit-card/credit-card.spec.js +++ b/src/global/credit-card/credit-card.spec.js @@ -1,6 +1,6 @@ 'use strict'; -describe('uiCreditCard', function() { +describe('uiCreditCardMask', function() { it('should load the demo page', function() { browser.get('/src/global/credit-card/credit-card.html'); expect(browser.getTitle()).toEqual('Credit Card Spec'); diff --git a/src/global/credit-card/credit-card.test.js b/src/global/credit-card/credit-card.test.js index a31c3892..012c3ca6 100644 --- a/src/global/credit-card/credit-card.test.js +++ b/src/global/credit-card/credit-card.test.js @@ -2,12 +2,12 @@ require('../global-masks'); -describe('ui-credit-card', function() { +describe('uiCreditCardMask', function() { beforeEach(angular.mock.module('ui.utils.masks.global')); it('should throw an error if used without ng-model', function() { expect(function() { - TestUtil.compile(''); + TestUtil.compile(''); }).toThrow(); }); @@ -15,7 +15,7 @@ describe('ui-credit-card', function() { var input = TestUtil.compile(''); var model = input.controller('ngModel'); - var maskedInput = TestUtil.compile(''); + var maskedInput = TestUtil.compile(''); var maskedModel = maskedInput.controller('ngModel'); expect(maskedModel.$parsers.length).toBe(model.$parsers.length + 1); @@ -23,7 +23,7 @@ describe('ui-credit-card', function() { }); it('should format initial model values', function() { - var input = TestUtil.compile('', { + var input = TestUtil.compile('', { model: '4242424242424242' }); @@ -32,8 +32,7 @@ describe('ui-credit-card', function() { }); it('should ignore non digits', function() { - var input = TestUtil.compile(''); + var input = TestUtil.compile(''); var model = input.controller('ngModel'); var tests = [ @@ -54,7 +53,7 @@ describe('ui-credit-card', function() { }); it('should validate a credit card number', function() { - var input = TestUtil.compile('', { + var input = TestUtil.compile('', { model: '417900' }); @@ -65,7 +64,7 @@ describe('ui-credit-card', function() { }); it('should use the type of the model value (if initialized)', function() { - var input = TestUtil.compile('', { + var input = TestUtil.compile('', { model: '7777333300008888' }); diff --git a/src/global/global-masks.js b/src/global/global-masks.js index b3f732a0..faf1c001 100644 --- a/src/global/global-masks.js +++ b/src/global/global-masks.js @@ -1,7 +1,7 @@ 'use strict'; var m = angular.module('ui.utils.masks.global', []) - .directive('uiCreditCard', require('./credit-card/credit-card')) + .directive('uiCreditCardMask', require('./credit-card/credit-card')) .directive('uiDateMask', require('./date/date')) .directive('uiMoneyMask', require('./money/money')) .directive('uiNumberMask', require('./number/number'))