| Index: third_party/pkg/angular/test/_specs_spec.dart
|
| diff --git a/third_party/pkg/angular/test/_specs_spec.dart b/third_party/pkg/angular/test/_specs_spec.dart
|
| index bb19bc1f9c46edc59deb2b28bf57093436324d51..f7994ab417e65c7ecd53989105d235e81fcbf6bb 100644
|
| --- a/third_party/pkg/angular/test/_specs_spec.dart
|
| +++ b/third_party/pkg/angular/test/_specs_spec.dart
|
| @@ -3,37 +3,46 @@ library _specs_spec;
|
| import '_specs.dart';
|
|
|
| main() {
|
| - describe('renderedText', () {
|
| - it('should work on regular DOM nodes', () {
|
| - expect(renderedText($('<span>A<span>C</span></span><span>B</span>'))).toEqual('ACB');
|
| - });
|
| + describe('expect', () {
|
| + describe('toHaveHtml', () {
|
| + it('should return html', (){
|
| + var div = es('<div>');
|
| + expect(es('<div>')).toHaveHtml('');
|
| + });
|
|
|
| - it('should work with shadow DOM', () {
|
| - var elt = $('<div>DOM content</div>');
|
| - var shadow = elt[0].createShadowRoot();
|
| - shadow.setInnerHtml(
|
| - '<div>Shadow content</div><content>SHADOW-CONTENT</content>',
|
| - treeSanitizer: new NullTreeSanitizer());
|
| - expect(renderedText(elt)).toEqual('Shadow contentDOM content');
|
| + it('should strip ng-binding', () {
|
| + var div = es('<div><span class="ng-binding"></span></div>');
|
| + expect(div).toHaveHtml('<span></span>');
|
| + });
|
| });
|
|
|
| - it('should ignore comments', () {
|
| - expect(renderedText($('<!--e--><span>A<span>C</span></span><span>B</span>'))).toEqual('ACB');
|
| - });
|
| - });
|
| + describe('toHaveText', () {
|
| + it('should work on regular DOM nodes', () {
|
| + expect(es('<span>A<span>C</span></span><span>B</span>'))
|
| + .toHaveText('ACB');
|
| + });
|
|
|
| + it('should work with shadow DOM', () {
|
| + var elt = e('<div>DOM content</div>');
|
| + var shadow = elt.createShadowRoot();
|
| + shadow.setInnerHtml(
|
| + '<div>Shadow content</div><content></content>',
|
| + treeSanitizer: new NullTreeSanitizer());
|
| + expect(elt).toHaveText('Shadow contentDOM content');
|
| + });
|
|
|
| - describe('jquery', () {
|
| - describe('html', () {
|
| - it('get', (){
|
| - var div = $('<div>');
|
| - expect(div.html()).toEqual('');
|
| + it('should work with shadow DOM even if content is not a direct child of shadow root', () {
|
| + var elt = e('<div>DOM content</div>');
|
| + var shadow = elt.createShadowRoot();
|
| + shadow.setInnerHtml(
|
| + '<div>Shadow content</div><span>:[<content></content>]</span>',
|
| + treeSanitizer: new NullTreeSanitizer());
|
| + expect(elt).toHaveText('Shadow content:[DOM content]');
|
| });
|
|
|
| - it('set', (){
|
| - var div = $('<div>');
|
| - expect(div.html('text')).toBe(div);
|
| - expect(div.html()).toEqual('text');
|
| + it('should ignore comments', () {
|
| + expect(es('<!--e--><span>A<span>C</span></span><span>B</span>'))
|
| + .toHaveText('ACB');
|
| });
|
| });
|
| });
|
|
|