Skip to content

Commit c079865

Browse files
chore: update to Angular 17.3 (#441)
1 parent b1ac6b8 commit c079865

File tree

3 files changed

+37
-39
lines changed

3 files changed

+37
-39
lines changed

package.json

+18-18
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,15 @@
2828
"prepare": "git config core.hookspath .githooks"
2929
},
3030
"dependencies": {
31-
"@angular/animations": "17.1.0",
32-
"@angular/cdk": "17.1.0",
33-
"@angular/common": "17.1.0",
34-
"@angular/compiler": "17.1.0",
35-
"@angular/core": "17.1.0",
36-
"@angular/material": "17.1.0",
37-
"@angular/platform-browser": "17.1.0",
38-
"@angular/platform-browser-dynamic": "17.1.0",
39-
"@angular/router": "17.1.0",
31+
"@angular/animations": "17.3.2",
32+
"@angular/cdk": "17.3.2",
33+
"@angular/common": "17.3.2",
34+
"@angular/compiler": "17.3.2",
35+
"@angular/core": "17.3.2",
36+
"@angular/material": "17.3.2",
37+
"@angular/platform-browser": "17.3.2",
38+
"@angular/platform-browser-dynamic": "17.3.2",
39+
"@angular/router": "17.3.2",
4040
"@ngrx/store": "17.1.0",
4141
"@nx/angular": "17.2.8",
4242
"@testing-library/dom": "^9.0.0",
@@ -45,25 +45,25 @@
4545
"zone.js": "0.14.2"
4646
},
4747
"devDependencies": {
48-
"@angular-devkit/build-angular": "17.1.0",
49-
"@angular-devkit/core": "17.1.0",
50-
"@angular-devkit/schematics": "17.1.0",
48+
"@angular-devkit/build-angular": "17.3.2",
49+
"@angular-devkit/core": "17.3.2",
50+
"@angular-devkit/schematics": "17.3.2",
5151
"@angular-eslint/builder": "17.0.1",
5252
"@angular-eslint/eslint-plugin": "17.0.1",
5353
"@angular-eslint/eslint-plugin-template": "17.0.1",
5454
"@angular-eslint/schematics": "17.0.1",
5555
"@angular-eslint/template-parser": "17.0.1",
56-
"@angular/cli": "~17.1.0",
57-
"@angular/compiler-cli": "17.1.0",
58-
"@angular/forms": "17.1.0",
59-
"@angular/language-service": "17.1.0",
56+
"@angular/cli": "~17.3.2",
57+
"@angular/compiler-cli": "17.3.2",
58+
"@angular/forms": "17.3.2",
59+
"@angular/language-service": "17.3.2",
6060
"@nx/eslint": "17.2.8",
6161
"@nx/eslint-plugin": "17.2.8",
6262
"@nx/jest": "17.2.8",
6363
"@nx/node": "17.2.8",
6464
"@nx/plugin": "17.2.8",
6565
"@nx/workspace": "17.2.8",
66-
"@schematics/angular": "17.1.0",
66+
"@schematics/angular": "17.3.2",
6767
"@testing-library/jasmine-dom": "^1.2.0",
6868
"@testing-library/jest-dom": "^5.16.5",
6969
"@testing-library/user-event": "^14.4.3",
@@ -93,7 +93,7 @@
9393
"karma-jasmine-html-reporter": "2.0.0",
9494
"lint-staged": "^12.1.6",
9595
"ng-mocks": "^14.11.0",
96-
"ng-packagr": "17.1.0",
96+
"ng-packagr": "17.3.0",
9797
"nx": "17.2.8",
9898
"postcss": "^8.4.5",
9999
"postcss-import": "14.1.0",

projects/testing-library/src/lib/testing-library.ts

+8-8
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@ import {
99
SimpleChanges,
1010
Type,
1111
} from '@angular/core';
12-
import {ComponentFixture, DeferBlockState, TestBed, tick} from '@angular/core/testing';
13-
import {BrowserAnimationsModule, NoopAnimationsModule} from '@angular/platform-browser/animations';
14-
import {NavigationExtras, Router} from '@angular/router';
15-
import {RouterTestingModule} from '@angular/router/testing';
16-
import type {BoundFunctions, Queries} from '@testing-library/dom';
12+
import { ComponentFixture, DeferBlockBehavior, DeferBlockState, TestBed, tick } from '@angular/core/testing';
13+
import { BrowserAnimationsModule, NoopAnimationsModule } from '@angular/platform-browser/animations';
14+
import { NavigationExtras, Router } from '@angular/router';
15+
import { RouterTestingModule } from '@angular/router/testing';
16+
import type { BoundFunctions, Queries } from '@testing-library/dom';
1717
import {
1818
configure as dtlConfigure,
1919
getQueriesForElement as dtlGetQueriesForElement,
@@ -25,8 +25,8 @@ import {
2525
waitForOptions as dtlWaitForOptions,
2626
within as dtlWithin,
2727
} from '@testing-library/dom';
28-
import {ComponentOverride, RenderComponentOptions, RenderResult, RenderTemplateOptions} from './models';
29-
import {getConfig} from './config';
28+
import { ComponentOverride, RenderComponentOptions, RenderResult, RenderTemplateOptions } from './models';
29+
import { getConfig } from './config';
3030

3131
const mountedFixtures = new Set<ComponentFixture<any>>();
3232
const safeInject = TestBed.inject || TestBed.get;
@@ -95,7 +95,7 @@ export async function render<SutType, WrapperType = SutType>(
9595
}),
9696
providers: [...providers],
9797
schemas: [...schemas],
98-
deferBlockBehavior: deferBlockBehavior as any
98+
deferBlockBehavior: deferBlockBehavior ?? DeferBlockBehavior.Manual,
9999
});
100100
overrideComponentImports(sut, componentImports);
101101
overrideChildComponentProviders(childComponentOverrides);

projects/testing-library/tests/defer-blocks.spec.ts

+11-13
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1-
import {Component} from '@angular/core';
2-
import {DeferBlockBehavior, DeferBlockState} from '@angular/core/testing';
3-
import {render, screen} from '../src/public_api';
4-
import {fireEvent} from "@testing-library/dom";
1+
import { Component } from '@angular/core';
2+
import { DeferBlockBehavior, DeferBlockState } from '@angular/core/testing';
3+
import { render, screen, fireEvent } from '../src/public_api';
54

65
test('renders a defer block in different states using the official API', async () => {
76
const { fixture } = await render(FixtureComponent);
@@ -30,21 +29,21 @@ test('renders a defer block in different states using ATL', async () => {
3029
});
3130

3231
test('renders a defer block in different states using DeferBlockBehavior.Playthrough', async () => {
33-
await render(FixtureComponent, {
34-
deferBlockBehavior: DeferBlockBehavior.Playthrough
32+
await render(FixtureComponent, {
33+
deferBlockBehavior: DeferBlockBehavior.Playthrough,
3534
});
3635

3736
expect(await screen.findByText(/loading/i)).toBeInTheDocument();
3837
expect(await screen.findByText(/Defer block content/i)).toBeInTheDocument();
3938
});
4039

4140
test('renders a defer block in different states using DeferBlockBehavior.Playthrough event', async () => {
42-
await render(FixtureComponentWithEvents, {
43-
deferBlockBehavior: DeferBlockBehavior.Playthrough
41+
await render(FixtureComponentWithEventsComponent, {
42+
deferBlockBehavior: DeferBlockBehavior.Playthrough,
4443
});
4544

46-
const button = screen.getByRole('button', {name: /click/i});
47-
fireEvent.click(button)
45+
const button = screen.getByRole('button', { name: /click/i });
46+
fireEvent.click(button);
4847

4948
expect(screen.getByText(/empty defer block/i)).toBeInTheDocument();
5049
});
@@ -91,9 +90,8 @@ class FixtureComponent {}
9190
template: `
9291
<button #trigger>Click</button>
9392
@defer(on interaction(trigger)) {
94-
<div>empty defer block</div>
93+
<div>empty defer block</div>
9594
}
9695
`,
9796
})
98-
class FixtureComponentWithEvents {}
99-
97+
class FixtureComponentWithEventsComponent {}

0 commit comments

Comments
 (0)