Skip to content
Permalink
Browse files

chore(angularFiles): add missing files

ngMessageFormat test files were missing from angularTest
ngMessages and ngAnimate were missing from karmaModules.

This change highlighted a number of problems in the tests and code,
which are now fixed.

Closes #14314
Closes #14669
  • Loading branch information
Narretz authored and petebacondarwin committed Mar 24, 2016
1 parent bf59aa5 commit 4a5723f83b80c2625b881a96df75efa4f4062a75
Showing with 130 additions and 118 deletions.
  1. +3 −0 angularFiles.js
  2. +6 −1 test/helpers/matchers.js
  3. +117 −117 test/ngAnimate/animateCssSpec.js
  4. +4 −0 test/ngMessages/messagesSpec.js
@@ -175,6 +175,7 @@ var angularFiles = {
'test/auto/*.js',
'test/ng/**/*.js',
'test/ngAnimate/*.js',
'test/ngMessageFormat/*.js',
'test/ngMessages/*.js',
'test/ngCookies/*.js',
'test/ngResource/*.js',
@@ -212,7 +213,9 @@ var angularFiles = {
'test/modules/no_bootstrap.js',
'src/ngScenario/browserTrigger.js',
'test/helpers/*.js',
'test/ngAnimate/*.js',
'test/ngMessageFormat/*.js',
'test/ngMessages/*.js',
'test/ngMock/*.js',
'test/ngCookies/*.js',
'test/ngRoute/**/*.js',
@@ -233,14 +233,19 @@ beforeEach(function() {
compare: generateCompare(false),
negativeCompare: generateCompare(true)
};
function hasClass(element, selector) {
if (!element.getAttribute) return false;
return ((" " + (element.getAttribute('class') || '') + " ").replace(/[\n\t]/g, " ").
indexOf(" " + selector + " ") > -1);
}
function generateCompare(isNot) {
return function(actual, clazz) {
var message = function() {
return "Expected '" + angular.mock.dump(actual) + "'" + (isNot ? " not " : "") + " to have class '" + clazz + "'.";
};
var classes = clazz.trim().split(/\s+/);
for (var i = 0; i < classes.length; ++i) {
if (!jqLiteHasClass(actual[0], classes[i])) {
if (!hasClass(actual[0], classes[i])) {
return { pass: isNot };
}
}

0 comments on commit 4a5723f

Please sign in to comment.
You can’t perform that action at this time.