mirror of
https://github.com/angular/angular.git
synced 2026-09-14 13:54:52 +08:00
refactor(docs-infra): remove deprecated modules from testing and use alternatives (#58847)
Removed the deprecated modules used in testing files and instead used the alternative one PR Close #58847
This commit is contained in:
committed by
Jessica Janiuk
parent
b21f96dc0e
commit
9a9d1bfcdc
@@ -8,8 +8,8 @@
|
||||
|
||||
import {ComponentFixture, TestBed} from '@angular/core/testing';
|
||||
import {By} from '@angular/platform-browser';
|
||||
import {NoopAnimationsModule} from '@angular/platform-browser/animations';
|
||||
import {RouterTestingModule} from '@angular/router/testing';
|
||||
import {provideNoopAnimations} from '@angular/platform-browser/animations';
|
||||
import {provideRouter} from '@angular/router';
|
||||
import {ExampleViewerContentLoader} from '../../../interfaces';
|
||||
import {EXAMPLE_VIEWER_CONTENT_LOADER} from '../../../providers';
|
||||
import {CodeExampleViewMode, ExampleViewer} from '../example-viewer/example-viewer.component';
|
||||
@@ -80,8 +80,10 @@ describe('DocViewer', () => {
|
||||
|
||||
beforeEach(async () => {
|
||||
await TestBed.configureTestingModule({
|
||||
imports: [DocViewer, NoopAnimationsModule, RouterTestingModule],
|
||||
imports: [DocViewer],
|
||||
providers: [
|
||||
provideNoopAnimations(),
|
||||
provideRouter([]),
|
||||
provideExperimentalZonelessChangeDetection(),
|
||||
{provide: EXAMPLE_VIEWER_CONTENT_LOADER, useValue: exampleContentSpy},
|
||||
{provide: NavigationState, useValue: navigationStateSpy},
|
||||
|
||||
@@ -11,7 +11,7 @@ import {ExampleViewer} from './example-viewer.component';
|
||||
import {DocsContentLoader, ExampleMetadata, ExampleViewerContentLoader} from '../../../interfaces';
|
||||
import {DOCS_CONTENT_LOADER, EXAMPLE_VIEWER_CONTENT_LOADER} from '../../../providers';
|
||||
import {Component, provideExperimentalZonelessChangeDetection} from '@angular/core';
|
||||
import {NoopAnimationsModule} from '@angular/platform-browser/animations';
|
||||
import {provideNoopAnimations} from '@angular/platform-browser/animations';
|
||||
import {HarnessLoader} from '@angular/cdk/testing';
|
||||
import {TestbedHarnessEnvironment} from '@angular/cdk/testing/testbed';
|
||||
import {Clipboard} from '@angular/cdk/clipboard';
|
||||
@@ -35,8 +35,9 @@ describe('ExampleViewer', () => {
|
||||
|
||||
beforeEach(async () => {
|
||||
await TestBed.configureTestingModule({
|
||||
imports: [ExampleViewer, NoopAnimationsModule],
|
||||
imports: [ExampleViewer],
|
||||
providers: [
|
||||
provideNoopAnimations(),
|
||||
provideExperimentalZonelessChangeDetection(),
|
||||
{provide: EXAMPLE_VIEWER_CONTENT_LOADER, useValue: exampleContentSpy},
|
||||
{provide: DOCS_CONTENT_LOADER, useValue: contentServiceSpy},
|
||||
|
||||
@@ -12,7 +12,7 @@ import {ChangeDetectorRef, signal} from '@angular/core';
|
||||
import {ComponentFixture, TestBed} from '@angular/core/testing';
|
||||
import {MatTabGroupHarness} from '@angular/material/tabs/testing';
|
||||
import {By} from '@angular/platform-browser';
|
||||
import {NoopAnimationsModule} from '@angular/platform-browser/animations';
|
||||
import {provideNoopAnimations} from '@angular/platform-browser/animations';
|
||||
import {BehaviorSubject} from 'rxjs';
|
||||
|
||||
import {EmbeddedTutorialManager} from '../embedded-tutorial-manager.service';
|
||||
@@ -21,7 +21,6 @@ import {CodeEditor, REQUIRED_FILES} from './code-editor.component';
|
||||
import {CodeMirrorEditor} from './code-mirror-editor.service';
|
||||
import {FakeChangeDetectorRef} from '@angular/docs';
|
||||
import {TutorialType} from '@angular/docs';
|
||||
import {MatTooltip} from '@angular/material/tooltip';
|
||||
import {MatTooltipHarness} from '@angular/material/tooltip/testing';
|
||||
|
||||
const files = [
|
||||
@@ -53,8 +52,9 @@ describe('CodeEditor', () => {
|
||||
|
||||
beforeEach(async () => {
|
||||
await TestBed.configureTestingModule({
|
||||
imports: [CodeEditor, NoopAnimationsModule, MatTooltip],
|
||||
imports: [CodeEditor],
|
||||
providers: [
|
||||
provideNoopAnimations(),
|
||||
{
|
||||
provide: CodeMirrorEditor,
|
||||
useValue: codeMirrorEditorService,
|
||||
|
||||
+4
-3
@@ -10,11 +10,11 @@ import {HarnessLoader} from '@angular/cdk/testing';
|
||||
import {TestbedHarnessEnvironment} from '@angular/cdk/testing/testbed';
|
||||
import {TestBed} from '@angular/core/testing';
|
||||
import {MatTabGroupHarness} from '@angular/material/tabs/testing';
|
||||
import {NoopAnimationsModule} from '@angular/platform-browser/animations';
|
||||
import {provideNoopAnimations} from '@angular/platform-browser/animations';
|
||||
import {ReferenceScrollHandler} from '../services/reference-scroll-handler.service';
|
||||
import {signal} from '@angular/core';
|
||||
import {provideRouter, withComponentInputBinding} from '@angular/router';
|
||||
import {RouterTestingHarness, RouterTestingModule} from '@angular/router/testing';
|
||||
import {RouterTestingHarness} from '@angular/router/testing';
|
||||
|
||||
import ApiReferenceDetailsPage from './api-reference-details-page.component';
|
||||
import {By} from '@angular/platform-browser';
|
||||
@@ -40,8 +40,9 @@ describe('ApiReferenceDetailsPage', () => {
|
||||
|
||||
beforeEach(async () => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [ApiReferenceDetailsPage, RouterTestingModule, NoopAnimationsModule],
|
||||
imports: [ApiReferenceDetailsPage],
|
||||
providers: [
|
||||
provideNoopAnimations(),
|
||||
provideRouter(
|
||||
[
|
||||
{
|
||||
|
||||
@@ -10,8 +10,8 @@ import {DOCS_VIEWER_SELECTOR, DocViewer, WINDOW} from '@angular/docs';
|
||||
|
||||
import {Component, Input, signal} from '@angular/core';
|
||||
import {ComponentFixture, TestBed} from '@angular/core/testing';
|
||||
import {NoopAnimationsModule} from '@angular/platform-browser/animations';
|
||||
import {RouterTestingModule} from '@angular/router/testing';
|
||||
import {provideNoopAnimations} from '@angular/platform-browser/animations';
|
||||
import {provideRouter} from '@angular/router';
|
||||
import {of} from 'rxjs';
|
||||
|
||||
import {
|
||||
@@ -96,8 +96,10 @@ describe('Tutorial', () => {
|
||||
|
||||
beforeEach(async () => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [Tutorial, RouterTestingModule, EmbeddedEditor, DocViewer, NoopAnimationsModule],
|
||||
imports: [Tutorial, EmbeddedEditor, DocViewer],
|
||||
providers: [
|
||||
provideNoopAnimations(),
|
||||
provideRouter([]),
|
||||
{
|
||||
provide: WINDOW,
|
||||
useValue: fakeWindow,
|
||||
|
||||
Reference in New Issue
Block a user