From 08f943a1f3dd74ad9475cb33d8f225392404f66e Mon Sep 17 00:00:00 2001 From: Vikram Subramanian Date: Thu, 31 May 2018 19:29:02 -0700 Subject: [PATCH] test(platform-server): add a test for 'hidden' property (#24239) Add a test to verify that the hidden property is reflected properly to the hidden attribute. PR Close #24239 --- .../platform-server/test/integration_spec.ts | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/packages/platform-server/test/integration_spec.ts b/packages/platform-server/test/integration_spec.ts index 4d8d8240c0..311b4f52a7 100644 --- a/packages/platform-server/test/integration_spec.ts +++ b/packages/platform-server/test/integration_spec.ts @@ -334,6 +334,20 @@ class TransferStoreModule { class EscapedTransferStoreModule { } +@Component({selector: 'app', template: ''}) +class MyHiddenComponent { + @Input() + name = ''; +} + +@NgModule({ + declarations: [MyHiddenComponent], + bootstrap: [MyHiddenComponent], + imports: [ServerModule, BrowserModule.withServerTransition({appId: 'hidden-attributes'})] +}) +class HiddenModule { +} + (function() { if (getDOM().supportsDOMEvents()) return; // NODE only @@ -613,6 +627,15 @@ class EscapedTransferStoreModule { }); })); + it('should handle element property "hidden"', async(() => { + renderModule(HiddenModule, {document: doc}).then(output => { + expect(output).toBe( + '' + + ''); + called = true; + }); + })); + it('should call render hook', async(() => { renderModule(RenderHookModule, {document: doc}).then(output => { // title should be added by the render hook.