Skip to content

Commit

Permalink
Merge pull request #1799 from l-lin/feat-ng18
Browse files Browse the repository at this point in the history
chore: upgrade to Angular v18
  • Loading branch information
l-lin authored Jun 30, 2024
2 parents a88e47d + a026651 commit 983afe0
Show file tree
Hide file tree
Showing 21 changed files with 4,564 additions and 2,749 deletions.
24 changes: 10 additions & 14 deletions demo/src/app/advanced/custom-range-search.component.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { RouterTestingModule } from '@angular/router/testing';
import { HttpClientModule } from '@angular/common/http';
import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http';
import { NO_ERRORS_SCHEMA, SecurityContext } from '@angular/core';
import { ComponentFixture, TestBed, tick, waitForAsync } from '@angular/core/testing';
import { DataTableDirective, DataTablesModule } from 'angular-datatables';
Expand All @@ -16,25 +16,21 @@ let fixture: ComponentFixture<CustomRangeSearchComponent>, component: null| Cust
describe('CustomRangeSearchComponent', () => {
beforeEach(() => {
fixture = TestBed.configureTestingModule({
declarations: [
declarations: [
BaseDemoComponent,
CustomRangeSearchComponent,
DataTableDirective
],
imports: [
AppRoutingModule,
],
schemas: [NO_ERRORS_SCHEMA],
imports: [AppRoutingModule,
RouterTestingModule,
DataTablesModule,
HttpClientModule,
MarkdownModule.forRoot(
{
MarkdownModule.forRoot({
sanitize: SecurityContext.NONE
}
),
FormsModule
],
schemas: [NO_ERRORS_SCHEMA]
}).createComponent(CustomRangeSearchComponent);
}),
FormsModule],
providers: [provideHttpClient(withInterceptorsFromDi())]
}).createComponent(CustomRangeSearchComponent);

component = fixture.componentInstance;

Expand Down
24 changes: 10 additions & 14 deletions demo/src/app/advanced/dt-instance.component.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { RouterTestingModule } from '@angular/router/testing';
import { HttpClientModule } from '@angular/common/http';
import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http';
import { NO_ERRORS_SCHEMA, SecurityContext } from '@angular/core';
import { ComponentFixture, TestBed, tick, waitForAsync } from '@angular/core/testing';
import { DataTableDirective, DataTablesModule } from 'angular-datatables';
Expand All @@ -16,25 +16,21 @@ let fixture: ComponentFixture<DtInstanceComponent>, component: null| DtInstanceC
describe('DtInstanceComponent', () => {
beforeEach(() => {
fixture = TestBed.configureTestingModule({
declarations: [
declarations: [
BaseDemoComponent,
DtInstanceComponent,
DataTableDirective
],
imports: [
AppRoutingModule,
],
schemas: [NO_ERRORS_SCHEMA],
imports: [AppRoutingModule,
RouterTestingModule,
DataTablesModule,
HttpClientModule,
MarkdownModule.forRoot(
{
MarkdownModule.forRoot({
sanitize: SecurityContext.NONE
}
),
FormsModule
],
schemas: [NO_ERRORS_SCHEMA]
}).createComponent(DtInstanceComponent);
}),
FormsModule],
providers: [provideHttpClient(withInterceptorsFromDi())]
}).createComponent(DtInstanceComponent);

component = fixture.componentInstance;

Expand Down
24 changes: 10 additions & 14 deletions demo/src/app/advanced/individual-column-filtering.component.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { RouterTestingModule } from '@angular/router/testing';
import { HttpClientModule } from '@angular/common/http';
import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http';
import { NO_ERRORS_SCHEMA, SecurityContext } from '@angular/core';
import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
import { DataTableDirective, DataTablesModule } from 'angular-datatables';
Expand All @@ -24,25 +24,21 @@ function applyValueToInput(inputElement: HTMLInputElement, value: string, table:
describe('IndividualColumnFilteringComponent', () => {
beforeEach(() => {
fixture = TestBed.configureTestingModule({
declarations: [
declarations: [
BaseDemoComponent,
IndividualColumnFilteringComponent,
DataTableDirective
],
imports: [
AppRoutingModule,
],
schemas: [NO_ERRORS_SCHEMA],
imports: [AppRoutingModule,
RouterTestingModule,
DataTablesModule,
HttpClientModule,
MarkdownModule.forRoot(
{
MarkdownModule.forRoot({
sanitize: SecurityContext.NONE
}
),
FormsModule
],
schemas: [NO_ERRORS_SCHEMA]
}).createComponent(IndividualColumnFilteringComponent);
}),
FormsModule],
providers: [provideHttpClient(withInterceptorsFromDi())]
}).createComponent(IndividualColumnFilteringComponent);

component = fixture.componentInstance;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { RouterTestingModule } from '@angular/router/testing';
import { HttpClientModule } from '@angular/common/http';
import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http';
import { NO_ERRORS_SCHEMA, SecurityContext } from '@angular/core';
import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
import { DataTableDirective, DataTablesModule } from 'angular-datatables';
Expand All @@ -16,25 +16,21 @@ let fixture: ComponentFixture<LoadDtOptionsWithPromiseComponent>, component: nul
describe('LoadDtOptionsWithPromiseComponent', () => {
beforeEach(() => {
fixture = TestBed.configureTestingModule({
declarations: [
declarations: [
BaseDemoComponent,
LoadDtOptionsWithPromiseComponent,
DataTableDirective
],
imports: [
AppRoutingModule,
],
schemas: [NO_ERRORS_SCHEMA],
imports: [AppRoutingModule,
RouterTestingModule,
DataTablesModule,
HttpClientModule,
MarkdownModule.forRoot(
{
MarkdownModule.forRoot({
sanitize: SecurityContext.NONE
}
),
FormsModule
],
schemas: [NO_ERRORS_SCHEMA]
}).createComponent(LoadDtOptionsWithPromiseComponent);
}),
FormsModule],
providers: [provideHttpClient(withInterceptorsFromDi())]
}).createComponent(LoadDtOptionsWithPromiseComponent);

component = fixture.componentInstance;

Expand Down
24 changes: 10 additions & 14 deletions demo/src/app/advanced/multiple-tables.component.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { RouterTestingModule } from '@angular/router/testing';
import { HttpClientModule } from '@angular/common/http';
import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http';
import { NO_ERRORS_SCHEMA, QueryList, SecurityContext } from '@angular/core';
import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
import { DataTableDirective, DataTablesModule } from 'angular-datatables';
Expand All @@ -16,25 +16,21 @@ let fixture: ComponentFixture<MultipleTablesComponent>, component: null| Multipl
describe('MultipleTablesComponent', () => {
beforeEach(() => {
fixture = TestBed.configureTestingModule({
declarations: [
declarations: [
BaseDemoComponent,
MultipleTablesComponent,
DataTableDirective
],
imports: [
AppRoutingModule,
],
schemas: [NO_ERRORS_SCHEMA],
imports: [AppRoutingModule,
RouterTestingModule,
DataTablesModule,
HttpClientModule,
MarkdownModule.forRoot(
{
MarkdownModule.forRoot({
sanitize: SecurityContext.NONE
}
),
FormsModule
],
schemas: [NO_ERRORS_SCHEMA]
}).createComponent(MultipleTablesComponent);
}),
FormsModule],
providers: [provideHttpClient(withInterceptorsFromDi())]
}).createComponent(MultipleTablesComponent);

component = fixture.componentInstance;

Expand Down
24 changes: 10 additions & 14 deletions demo/src/app/advanced/rerender.component.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { RouterTestingModule } from '@angular/router/testing';
import { HttpClientModule } from '@angular/common/http';
import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http';
import { NO_ERRORS_SCHEMA, SecurityContext } from '@angular/core';
import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
import { DataTableDirective, DataTablesModule } from 'angular-datatables';
Expand All @@ -15,25 +15,21 @@ let fixture: ComponentFixture<RerenderComponent>, component: null| RerenderCompo
describe('RerenderComponent', () => {
beforeEach(() => {
fixture = TestBed.configureTestingModule({
declarations: [
declarations: [
BaseDemoComponent,
RerenderComponent,
DataTableDirective
],
imports: [
AppRoutingModule,
],
schemas: [NO_ERRORS_SCHEMA],
imports: [AppRoutingModule,
RouterTestingModule,
DataTablesModule,
HttpClientModule,
MarkdownModule.forRoot(
{
MarkdownModule.forRoot({
sanitize: SecurityContext.NONE
}
),
FormsModule
],
schemas: [NO_ERRORS_SCHEMA]
}).createComponent(RerenderComponent);
}),
FormsModule],
providers: [provideHttpClient(withInterceptorsFromDi())]
}).createComponent(RerenderComponent);

component = fixture.componentInstance;

Expand Down
24 changes: 10 additions & 14 deletions demo/src/app/advanced/router-link.component.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { RouterTestingModule } from '@angular/router/testing';
import { HttpClientModule } from '@angular/common/http';
import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http';
import { NO_ERRORS_SCHEMA, SecurityContext } from '@angular/core';
import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
import { DataTableDirective, DataTablesModule } from 'angular-datatables';
Expand All @@ -18,26 +18,22 @@ let fixture: ComponentFixture<RouterLinkComponent>, component: null| RouterLinkC
describe('RouterLinkComponent', () => {
beforeEach(() => {
fixture = TestBed.configureTestingModule({
declarations: [
declarations: [
BaseDemoComponent,
DemoNgComponent,
RouterLinkComponent,
DataTableDirective
],
imports: [
AppRoutingModule,
],
schemas: [NO_ERRORS_SCHEMA],
imports: [AppRoutingModule,
RouterTestingModule,
DataTablesModule,
HttpClientModule,
MarkdownModule.forRoot(
{
MarkdownModule.forRoot({
sanitize: SecurityContext.NONE
}
),
FormsModule
],
schemas: [NO_ERRORS_SCHEMA]
}).createComponent(RouterLinkComponent);
}),
FormsModule],
providers: [provideHttpClient(withInterceptorsFromDi())]
}).createComponent(RouterLinkComponent);

component = fixture.componentInstance;
router = TestBed.inject(Router);
Expand Down
24 changes: 10 additions & 14 deletions demo/src/app/advanced/row-click-event.component.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { RouterTestingModule } from '@angular/router/testing';
import { HttpClientModule } from '@angular/common/http';
import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http';
import { NO_ERRORS_SCHEMA, SecurityContext } from '@angular/core';
import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
import { DataTableDirective, DataTablesModule } from 'angular-datatables';
Expand All @@ -15,25 +15,21 @@ let fixture: ComponentFixture<RowClickEventComponent>, component: null| RowClick
describe('RowClickEventComponent', () => {
beforeEach(() => {
fixture = TestBed.configureTestingModule({
declarations: [
declarations: [
BaseDemoComponent,
RowClickEventComponent,
DataTableDirective
],
imports: [
AppRoutingModule,
],
schemas: [NO_ERRORS_SCHEMA],
imports: [AppRoutingModule,
RouterTestingModule,
DataTablesModule,
HttpClientModule,
MarkdownModule.forRoot(
{
MarkdownModule.forRoot({
sanitize: SecurityContext.NONE
}
),
FormsModule
],
schemas: [NO_ERRORS_SCHEMA]
}).createComponent(RowClickEventComponent);
}),
FormsModule],
providers: [provideHttpClient(withInterceptorsFromDi())]
}).createComponent(RowClickEventComponent);

component = fixture.componentInstance;

Expand Down
30 changes: 13 additions & 17 deletions demo/src/app/advanced/using-ng-pipe.component.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { RouterTestingModule } from '@angular/router/testing';
import { HttpClientModule } from '@angular/common/http';
import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http';
import { NO_ERRORS_SCHEMA, SecurityContext } from '@angular/core';
import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
import { DataTableDirective, DataTablesModule } from 'angular-datatables';
Expand All @@ -18,29 +18,25 @@ let fixture: ComponentFixture<UsingNgPipeComponent>, component: null| UsingNgPip
describe('UsingNgPipeComponent', () => {
beforeEach(() => {
fixture = TestBed.configureTestingModule({
declarations: [
declarations: [
BaseDemoComponent,
UsingNgPipeComponent,
DataTableDirective
],
imports: [
AppRoutingModule,
],
schemas: [NO_ERRORS_SCHEMA],
imports: [AppRoutingModule,
RouterTestingModule,
DataTablesModule,
HttpClientModule,
MarkdownModule.forRoot(
{
MarkdownModule.forRoot({
sanitize: SecurityContext.NONE
}
),
FormsModule
],
schemas: [NO_ERRORS_SCHEMA],
providers: [
}),
FormsModule],
providers: [
UpperCasePipe,
CurrencyPipe
]
}).createComponent(UsingNgPipeComponent);
CurrencyPipe,
provideHttpClient(withInterceptorsFromDi())
]
}).createComponent(UsingNgPipeComponent);

component = fixture.componentInstance;

Expand Down
Loading

0 comments on commit 983afe0

Please sign in to comment.