angular/integration/platform-server/e2e/src/defer-spec.ts
Alan Agius 0c9e7d980e test: add integration test for defer with input on SSR with zones (#61040)
Add an integration test to verify defer block behavior with input handling during server-side rendering (SSR).

PR Close #61040
2025-04-30 12:37:01 -07:00

27 lines
936 B
TypeScript

import {browser, by, element} from 'protractor';
import {bootstrapClientApp, navigateTo, verifyNoBrowserErrors} from './util';
describe('Defer E2E Tests', () => {
beforeEach(async () => {
// Don't wait for Angular since it is not bootstrapped automatically.
await browser.waitForAngularEnabled(false);
// Load the page without waiting for Angular since it is not bootstrapped automatically.
await navigateTo('defer');
});
afterEach(async () => {
// Make sure there were no client side errors.
await verifyNoBrowserErrors();
});
it('should text in defered component with input', async () => {
// Test the contents from the server.
expect(await element(by.css('p')).getText()).toEqual('Hydrate Never works!');
await bootstrapClientApp();
// Retest the contents after the client bootstraps.
expect(await element(by.css('p')).getText()).toEqual('Hydrate Never works!');
});
});