refactor(core): remove cookie and comment testing utilities from DomAdapters (#32278)
PR Close #32278
This commit is contained in:
@ -19,7 +19,7 @@ import {EmbeddedViewRef} from '@angular/core/src/linker/view_ref';
|
||||
import {Attribute, Component, ContentChildren, Directive, HostBinding, HostListener, Input, Output, Pipe} from '@angular/core/src/metadata';
|
||||
import {TestBed, async, fakeAsync, getTestBed, tick} from '@angular/core/testing';
|
||||
import {getDOM} from '@angular/platform-browser/src/dom/dom_adapter';
|
||||
import {dispatchEvent, el} from '@angular/platform-browser/testing/src/browser_util';
|
||||
import {dispatchEvent, el, isCommentNode} from '@angular/platform-browser/testing/src/browser_util';
|
||||
import {expect} from '@angular/platform-browser/testing/src/matchers';
|
||||
import {modifiedInIvy, obsoleteInIvy, onlyInIvy} from '@angular/private/testing';
|
||||
|
||||
@ -430,7 +430,7 @@ function declareTests(config?: {useJit: boolean}) {
|
||||
|
||||
const childNodesOfWrapper = getDOM().childNodes(fixture.nativeElement);
|
||||
expect(childNodesOfWrapper.length).toBe(1);
|
||||
expect(getDOM().isCommentNode(childNodesOfWrapper[0])).toBe(true);
|
||||
expect(isCommentNode(childNodesOfWrapper[0])).toBe(true);
|
||||
});
|
||||
|
||||
it('should allow to transplant TemplateRefs into other ViewContainers', () => {
|
||||
|
@ -10,6 +10,7 @@
|
||||
import {AfterContentInit, AfterViewInit, Component, ContentChildren, Directive, Input, QueryList, ViewChildren, ɵivyEnabled as ivyEnabled} from '@angular/core';
|
||||
import {TestBed} from '@angular/core/testing';
|
||||
import {getDOM} from '@angular/platform-browser/src/dom/dom_adapter';
|
||||
import {isCommentNode} from '@angular/platform-browser/testing/src/browser_util';
|
||||
import {expect} from '@angular/platform-browser/testing/src/matchers';
|
||||
import {modifiedInIvy} from '@angular/private/testing';
|
||||
|
||||
@ -58,7 +59,7 @@ function declareTests(config?: {useJit: boolean}) {
|
||||
const el = fixture.nativeElement;
|
||||
const children = getDOM().childNodes(el);
|
||||
expect(children.length).toBe(2);
|
||||
expect(getDOM().isCommentNode(children[0])).toBe(true);
|
||||
expect(isCommentNode(children[0])).toBe(true);
|
||||
expect(getDOM().tagName(children[1]).toUpperCase()).toEqual('P');
|
||||
});
|
||||
|
||||
@ -74,10 +75,10 @@ function declareTests(config?: {useJit: boolean}) {
|
||||
const el = fixture.nativeElement;
|
||||
const children = getDOM().childNodes(el);
|
||||
expect(children.length).toBe(5);
|
||||
expect(getDOM().isCommentNode(children[0])).toBe(true);
|
||||
expect(isCommentNode(children[0])).toBe(true);
|
||||
expect(children[1]).toHaveText('1');
|
||||
expect(getDOM().isCommentNode(children[2])).toBe(true);
|
||||
expect(getDOM().isCommentNode(children[3])).toBe(true);
|
||||
expect(isCommentNode(children[2])).toBe(true);
|
||||
expect(isCommentNode(children[3])).toBe(true);
|
||||
expect(children[4]).toHaveText('2');
|
||||
});
|
||||
|
||||
@ -95,9 +96,9 @@ function declareTests(config?: {useJit: boolean}) {
|
||||
|
||||
expect(children.length).toBe(4);
|
||||
// ngIf anchor
|
||||
expect(getDOM().isCommentNode(children[0])).toBe(true);
|
||||
expect(isCommentNode(children[0])).toBe(true);
|
||||
// ng-container anchor
|
||||
expect(getDOM().isCommentNode(children[1])).toBe(true);
|
||||
expect(isCommentNode(children[1])).toBe(true);
|
||||
expect(getDOM().tagName(children[2]).toUpperCase()).toEqual('P');
|
||||
expect(getDOM().tagName(children[3]).toUpperCase()).toEqual('B');
|
||||
|
||||
@ -105,7 +106,7 @@ function declareTests(config?: {useJit: boolean}) {
|
||||
fixture.detectChanges();
|
||||
|
||||
expect(children.length).toBe(1);
|
||||
expect(getDOM().isCommentNode(children[0])).toBe(true);
|
||||
expect(isCommentNode(children[0])).toBe(true);
|
||||
});
|
||||
|
||||
it('should work with static content projection', () => {
|
||||
|
Reference in New Issue
Block a user