From e013aee6364cb22d4b962aac2b102ffaca084f2f Mon Sep 17 00:00:00 2001 From: cexbrayat Date: Sun, 8 Sep 2019 17:33:21 +0200 Subject: [PATCH] refactor(ivy): migrate export spec from render3 (#32624) The remaining test was using JS blocks and was already tested with `ngIf` in the existing acceptance test. PR Close #32624 --- packages/core/test/render3/exports_spec.ts | 62 ---------------------- 1 file changed, 62 deletions(-) delete mode 100644 packages/core/test/render3/exports_spec.ts diff --git a/packages/core/test/render3/exports_spec.ts b/packages/core/test/render3/exports_spec.ts deleted file mode 100644 index c5bbf9acd5..0000000000 --- a/packages/core/test/render3/exports_spec.ts +++ /dev/null @@ -1,62 +0,0 @@ -/** - * @license - * Copyright Google Inc. 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 {ɵɵcontainer, ɵɵcontainerRefreshEnd, ɵɵcontainerRefreshStart, ɵɵelement, ɵɵelementEnd, ɵɵelementStart, ɵɵembeddedViewEnd, ɵɵembeddedViewStart, ɵɵreference, ɵɵselect, ɵɵtext, ɵɵtextInterpolate} from '../../src/render3/instructions/all'; -import {RenderFlags} from '../../src/render3/interfaces/definition'; -import {ComponentFixture, createComponent} from './render_util'; - -describe('exports', () => { - // For basic use cases, see core/test/acceptance/exports_spec.ts. - - describe('forward refs', () => { - - /** - * This test needs to be moved to acceptance/exports_spec.ts - * when Ivy compiler supports inline views. - */ - it('should work inside a view container', () => { - const App = createComponent('app', function(rf: RenderFlags, ctx: any) { - if (rf & RenderFlags.Create) { - ɵɵelementStart(0, 'div'); - { ɵɵcontainer(1); } - ɵɵelementEnd(); - } - if (rf & RenderFlags.Update) { - ɵɵcontainerRefreshStart(1); - { - if (ctx.condition) { - let rf1 = ɵɵembeddedViewStart(1, 2, 1); - { - if (rf1 & RenderFlags.Create) { - ɵɵtext(0); - ɵɵelement(1, 'input', ['value', 'one'], ['myInput', '']); - } - if (rf1 & RenderFlags.Update) { - const tmp = ɵɵreference(2) as any; - ɵɵselect(0); - ɵɵtextInterpolate(tmp.value); - } - } - ɵɵembeddedViewEnd(); - } - } - ɵɵcontainerRefreshEnd(); - } - }, 2); - - const fixture = new ComponentFixture(App); - fixture.component.condition = true; - fixture.update(); - expect(fixture.html).toEqual('
one
'); - - fixture.component.condition = false; - fixture.update(); - expect(fixture.html).toEqual('
'); - }); - }); -});