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

Commit c81e355

Browse files
committed
test($compile): fix incorrect markup in tests
1 parent 8cc69b9 commit c81e355

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

test/ng/compileSpec.js

+7-7
Original file line numberDiff line numberDiff line change
@@ -11703,37 +11703,37 @@ describe('$compile', function() {
1170311703
// All interpolations are disallowed.
1170411704
$rootScope.onClickJs = '';
1170511705
expect(function() {
11706-
$compile('<button onclick="{{onClickJs}}"></script>');
11706+
$compile('<button onclick="{{onClickJs}}"></button>');
1170711707
}).toThrowMinErr(
1170811708
'$compile', 'nodomevents', 'Interpolations for HTML DOM event attributes are disallowed');
1170911709
expect(function() {
11710-
$compile('<button ONCLICK="{{onClickJs}}"></script>');
11710+
$compile('<button ONCLICK="{{onClickJs}}"></button>');
1171111711
}).toThrowMinErr(
1171211712
'$compile', 'nodomevents', 'Interpolations for HTML DOM event attributes are disallowed');
1171311713
expect(function() {
11714-
$compile('<button ng-attr-onclick="{{onClickJs}}"></script>');
11714+
$compile('<button ng-attr-onclick="{{onClickJs}}"></button>');
1171511715
}).toThrowMinErr(
1171611716
'$compile', 'nodomevents', 'Interpolations for HTML DOM event attributes are disallowed');
1171711717
expect(function() {
11718-
$compile('<button ng-attr-ONCLICK="{{onClickJs}}"></script>');
11718+
$compile('<button ng-attr-ONCLICK="{{onClickJs}}"></button>');
1171911719
}).toThrowMinErr(
1172011720
'$compile', 'nodomevents', 'Interpolations for HTML DOM event attributes are disallowed');
1172111721
}));
1172211722

1172311723
it('should pass through arbitrary values on onXYZ event attributes that contain a hyphen', inject(function($compile, $rootScope) {
11724-
element = $compile('<button on-click="{{onClickJs}}"></script>')($rootScope);
11724+
element = $compile('<button on-click="{{onClickJs}}"></button>')($rootScope);
1172511725
$rootScope.onClickJs = 'javascript:doSomething()';
1172611726
$rootScope.$apply();
1172711727
expect(element.attr('on-click')).toEqual('javascript:doSomething()');
1172811728
}));
1172911729

1173011730
it('should pass through arbitrary values on "on" and "data-on" attributes', inject(function($compile, $rootScope) {
11731-
element = $compile('<button data-on="{{dataOnVar}}"></script>')($rootScope);
11731+
element = $compile('<button data-on="{{dataOnVar}}"></button>')($rootScope);
1173211732
$rootScope.dataOnVar = 'data-on text';
1173311733
$rootScope.$apply();
1173411734
expect(element.attr('data-on')).toEqual('data-on text');
1173511735

11736-
element = $compile('<button on="{{onVar}}"></script>')($rootScope);
11736+
element = $compile('<button on="{{onVar}}"></button>')($rootScope);
1173711737
$rootScope.onVar = 'on text';
1173811738
$rootScope.$apply();
1173911739
expect(element.attr('on')).toEqual('on text');

test/ng/ngPropSpec.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -147,11 +147,11 @@ describe('ngProp*', function() {
147147
it('should disallow property binding to onclick', inject(function($compile, $rootScope) {
148148
// All event prop bindings are disallowed.
149149
expect(function() {
150-
$compile('<button ng-prop-onclick="onClickJs"></script>');
150+
$compile('<button ng-prop-onclick="onClickJs"></button>');
151151
}).toThrowMinErr(
152152
'$compile', 'nodomevents', 'Property bindings for HTML DOM event properties are disallowed');
153153
expect(function() {
154-
$compile('<button ng-prop-ONCLICK="onClickJs"></script>');
154+
$compile('<button ng-prop-ONCLICK="onClickJs"></button>');
155155
}).toThrowMinErr(
156156
'$compile', 'nodomevents', 'Property bindings for HTML DOM event properties are disallowed');
157157
}));

0 commit comments

Comments
 (0)