Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Commit 4a5723f

Browse files
Narretzpetebacondarwin
authored andcommitted
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
1 parent bf59aa5 commit 4a5723f

File tree

4 files changed

+130
-118
lines changed

4 files changed

+130
-118
lines changed

angularFiles.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,7 @@ var angularFiles = {
175175
'test/auto/*.js',
176176
'test/ng/**/*.js',
177177
'test/ngAnimate/*.js',
178+
'test/ngMessageFormat/*.js',
178179
'test/ngMessages/*.js',
179180
'test/ngCookies/*.js',
180181
'test/ngResource/*.js',
@@ -212,7 +213,9 @@ var angularFiles = {
212213
'test/modules/no_bootstrap.js',
213214
'src/ngScenario/browserTrigger.js',
214215
'test/helpers/*.js',
216+
'test/ngAnimate/*.js',
215217
'test/ngMessageFormat/*.js',
218+
'test/ngMessages/*.js',
216219
'test/ngMock/*.js',
217220
'test/ngCookies/*.js',
218221
'test/ngRoute/**/*.js',

test/helpers/matchers.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,14 +233,19 @@ beforeEach(function() {
233233
compare: generateCompare(false),
234234
negativeCompare: generateCompare(true)
235235
};
236+
function hasClass(element, selector) {
237+
if (!element.getAttribute) return false;
238+
return ((" " + (element.getAttribute('class') || '') + " ").replace(/[\n\t]/g, " ").
239+
indexOf(" " + selector + " ") > -1);
240+
}
236241
function generateCompare(isNot) {
237242
return function(actual, clazz) {
238243
var message = function() {
239244
return "Expected '" + angular.mock.dump(actual) + "'" + (isNot ? " not " : "") + " to have class '" + clazz + "'.";
240245
};
241246
var classes = clazz.trim().split(/\s+/);
242247
for (var i = 0; i < classes.length; ++i) {
243-
if (!jqLiteHasClass(actual[0], classes[i])) {
248+
if (!hasClass(actual[0], classes[i])) {
244249
return { pass: isNot };
245250
}
246251
}

0 commit comments

Comments
 (0)