mirror of
https://github.com/angular/angular
synced 2026-05-24 09:28:37 +00:00
Prior to this change component styles generated on the server where removed prior to the client side component being rendered and attached it's own styles. In some cases this caused flickering. To mitigate this `initialNavigation: enabledBlocking'` was introduced which allowed the remove of server styles to be defer to a latter stage when the application has finished initialization. This commit changes the need for this, by not removing the server generated component styles and reuse them for client side rendering. PR Close #48253
38 lines
1.4 KiB
TypeScript
38 lines
1.4 KiB
TypeScript
/**
|
|
* @license
|
|
* Copyright Google LLC All Rights Reserved.
|
|
*
|
|
* Use of this source code is governed by an MIT-style license that can be
|
|
* found in the LICENSE file at https://angular.io/license
|
|
*/
|
|
|
|
import {browser, by, element} from 'protractor';
|
|
|
|
import {verifyNoBrowserErrors} from './util';
|
|
|
|
describe('Hello world E2E Tests', function() {
|
|
it('should display: Hello world!', function() {
|
|
// Load the page without waiting for Angular since it is not bootstrapped automatically.
|
|
browser.driver.get(browser.baseUrl + 'helloworld');
|
|
|
|
const style = browser.driver.findElement(by.css('style[ng-app="hlw"]'));
|
|
expect(style.getText()).not.toBeNull();
|
|
|
|
// Test the contents from the server.
|
|
const serverDiv = browser.driver.findElement(by.css('div'));
|
|
expect(serverDiv.getText()).toEqual('Hello world!');
|
|
// Bootstrap the client side app.
|
|
browser.executeScript('doBootstrap()');
|
|
|
|
// Retest the contents after the client bootstraps.
|
|
expect(element(by.css('div')).getText()).toEqual('Hello world!');
|
|
|
|
// Make sure the server styles get reused by the client.
|
|
expect(element(by.css('style[ng-app="hlw"]')).isPresent()).toBeFalsy();
|
|
expect(element(by.css('style[ng-style-reused]')).isPresent()).toBeTruthy()
|
|
expect(element(by.css('style')).getText()).toBe('');
|
|
|
|
// Make sure there were no client side errors.
|
|
verifyNoBrowserErrors();
|
|
});
|
|
});
|