Files
angular.js/test/e2e/tests/sample.spec.js
T
Krzysztof Kotowicz 2518966153 fix(grunt-utils): insert the core CSS styles without using innerHTML
Create style elements and modify their text content instead of using
innerHTML to create the whole `<style>` element with its content.
That way style insertion done at bootstrap time doesn't interfere with
Trusted Types restrictions in Chrome (https://bit.ly/trusted-types).

Remove the type attribute - `text/css` is default:
https://html.spec.whatwg.org/#update-a-style-block.

Closes #17014
2020-05-25 11:17:53 +03:00

22 lines
558 B
JavaScript

'use strict';
// Sample E2E test:
describe('Sample', function() {
beforeEach(function() {
loadFixture('sample');
});
it('should have the interpolated text', function() {
expect(element(by.binding('text')).getText()).toBe('Hello, world!');
});
it('should insert the ng-cloak styles', function() {
browser.executeScript(`
var span = document.createElement('span');
span.className = 'ng-cloak foo';
document.body.appendChild(span);
`);
expect(element(by.className('foo')).isDisplayed()).toBe(false);
});
});