| 82 | |
| 83 | describe('options', () => { |
| 84 | function createComponentAndModule( |
| 85 | options: { |
| 86 | encapsulation?: ViewEncapsulation; |
| 87 | preserveWhitespaces?: boolean; |
| 88 | selector?: string; |
| 89 | } = {}, |
| 90 | ) { |
| 91 | @Component({ |
| 92 | selector: options.selector || 'my-app', |
| 93 | // styles must be non-empty to trigger `ViewEncapsulation.Emulated` |
| 94 | styles: 'span {color:red}', |
| 95 | template: '<span>a b</span>', |
| 96 | encapsulation: options.encapsulation, |
| 97 | preserveWhitespaces: options.preserveWhitespaces, |
| 98 | jit: true, |
| 99 | standalone: false, |
| 100 | }) |
| 101 | class TestComponent {} |
| 102 | |
| 103 | @NgModule({ |
| 104 | imports: [BrowserModule], |
| 105 | declarations: [TestComponent], |
| 106 | bootstrap: [TestComponent], |
| 107 | jit: true, |
| 108 | }) |
| 109 | class TestModule {} |
| 110 | |
| 111 | return TestModule; |
| 112 | } |
| 113 | |
| 114 | it( |
| 115 | 'should use ViewEncapsulation.Emulated as default', |