@angular/platform-browser 20.0.0-next.1 → 20.0.0-next.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/animations/async/index.d.ts +16 -25
- package/animations/index.d.ts +32 -43
- package/fesm2022/animations/async.mjs +10 -28
- package/fesm2022/animations/async.mjs.map +1 -1
- package/fesm2022/animations.mjs +23 -41
- package/fesm2022/animations.mjs.map +1 -1
- package/fesm2022/platform-browser.mjs +128 -132
- package/fesm2022/platform-browser.mjs.map +1 -1
- package/fesm2022/testing.mjs +58 -28
- package/fesm2022/testing.mjs.map +1 -1
- package/index.d.ts +555 -601
- package/package.json +4 -4
- package/testing/index.d.ts +21 -10
package/fesm2022/testing.mjs
CHANGED
@@ -1,17 +1,59 @@
|
|
1
1
|
/**
|
2
|
-
* @license Angular v20.0.0-next.
|
2
|
+
* @license Angular v20.0.0-next.3
|
3
3
|
* (c) 2010-2025 Google LLC. https://angular.io/
|
4
4
|
* License: MIT
|
5
5
|
*/
|
6
6
|
|
7
|
-
import { PlatformLocation } from '@angular/common';
|
7
|
+
import { ɵgetDOM as _getDOM, DOCUMENT, PlatformLocation } from '@angular/common';
|
8
8
|
import { MockPlatformLocation } from '@angular/common/testing';
|
9
9
|
import * as i0 from '@angular/core';
|
10
|
-
import {
|
11
|
-
import {
|
10
|
+
import { Inject, Injectable, createPlatformFactory, platformCore, PLATFORM_INITIALIZER, APP_ID, ɵinternalProvideZoneChangeDetection as _internalProvideZoneChangeDetection, ɵChangeDetectionSchedulerImpl as _ChangeDetectionSchedulerImpl, ɵChangeDetectionScheduler as _ChangeDetectionScheduler, NgModule } from '@angular/core';
|
11
|
+
import { TestComponentRenderer } from '@angular/core/testing';
|
12
|
+
import { BrowserModule, ɵBrowserDomAdapter as _BrowserDomAdapter } from '@angular/platform-browser';
|
13
|
+
|
14
|
+
/**
|
15
|
+
* A DOM based implementation of the TestComponentRenderer.
|
16
|
+
*/
|
17
|
+
class DOMTestComponentRenderer extends TestComponentRenderer {
|
18
|
+
_doc;
|
19
|
+
constructor(_doc) {
|
20
|
+
super();
|
21
|
+
this._doc = _doc;
|
22
|
+
}
|
23
|
+
insertRootElement(rootElId) {
|
24
|
+
this.removeAllRootElementsImpl();
|
25
|
+
const rootElement = _getDOM().getDefaultDocument().createElement('div');
|
26
|
+
rootElement.setAttribute('id', rootElId);
|
27
|
+
this._doc.body.appendChild(rootElement);
|
28
|
+
}
|
29
|
+
removeAllRootElements() {
|
30
|
+
// Check whether the `DOCUMENT` instance retrieved from DI contains
|
31
|
+
// the necessary function to complete the cleanup. In tests that don't
|
32
|
+
// interact with DOM, the `DOCUMENT` might be mocked and some functions
|
33
|
+
// might be missing. For such tests, DOM cleanup is not required and
|
34
|
+
// we skip the logic if there are missing functions.
|
35
|
+
if (typeof this._doc.querySelectorAll === 'function') {
|
36
|
+
this.removeAllRootElementsImpl();
|
37
|
+
}
|
38
|
+
}
|
39
|
+
removeAllRootElementsImpl() {
|
40
|
+
const oldRoots = this._doc.querySelectorAll('[id^=root]');
|
41
|
+
for (let i = 0; i < oldRoots.length; i++) {
|
42
|
+
_getDOM().remove(oldRoots[i]);
|
43
|
+
}
|
44
|
+
}
|
45
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0-next.3", ngImport: i0, type: DOMTestComponentRenderer, deps: [{ token: DOCUMENT }], target: i0.ɵɵFactoryTarget.Injectable });
|
46
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.0.0-next.3", ngImport: i0, type: DOMTestComponentRenderer });
|
47
|
+
}
|
48
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0-next.3", ngImport: i0, type: DOMTestComponentRenderer, decorators: [{
|
49
|
+
type: Injectable
|
50
|
+
}], ctorParameters: () => [{ type: undefined, decorators: [{
|
51
|
+
type: Inject,
|
52
|
+
args: [DOCUMENT]
|
53
|
+
}] }] });
|
12
54
|
|
13
55
|
function initBrowserTests() {
|
14
|
-
|
56
|
+
_BrowserDomAdapter.makeCurrent();
|
15
57
|
}
|
16
58
|
const _TEST_BROWSER_PLATFORM_PROVIDERS = [
|
17
59
|
{ provide: PLATFORM_INITIALIZER, useValue: initBrowserTests, multi: true },
|
@@ -28,41 +70,29 @@ const platformBrowserTesting = createPlatformFactory(platformCore, 'browserTesti
|
|
28
70
|
* @publicApi
|
29
71
|
*/
|
30
72
|
class BrowserTestingModule {
|
31
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0-next.
|
32
|
-
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.0.0-next.
|
33
|
-
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.0.0-next.
|
73
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0-next.3", ngImport: i0, type: BrowserTestingModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
74
|
+
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.0.0-next.3", ngImport: i0, type: BrowserTestingModule, exports: [BrowserModule] });
|
75
|
+
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.0.0-next.3", ngImport: i0, type: BrowserTestingModule, providers: [
|
34
76
|
{ provide: APP_ID, useValue: 'a' },
|
35
|
-
|
36
|
-
{ provide:
|
77
|
+
_internalProvideZoneChangeDetection({}),
|
78
|
+
{ provide: _ChangeDetectionScheduler, useExisting: _ChangeDetectionSchedulerImpl },
|
37
79
|
{ provide: PlatformLocation, useClass: MockPlatformLocation },
|
80
|
+
{ provide: TestComponentRenderer, useClass: DOMTestComponentRenderer },
|
38
81
|
], imports: [BrowserModule] });
|
39
82
|
}
|
40
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0-next.
|
83
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0-next.3", ngImport: i0, type: BrowserTestingModule, decorators: [{
|
41
84
|
type: NgModule,
|
42
85
|
args: [{
|
43
86
|
exports: [BrowserModule],
|
44
87
|
providers: [
|
45
88
|
{ provide: APP_ID, useValue: 'a' },
|
46
|
-
|
47
|
-
{ provide:
|
89
|
+
_internalProvideZoneChangeDetection({}),
|
90
|
+
{ provide: _ChangeDetectionScheduler, useExisting: _ChangeDetectionSchedulerImpl },
|
48
91
|
{ provide: PlatformLocation, useClass: MockPlatformLocation },
|
92
|
+
{ provide: TestComponentRenderer, useClass: DOMTestComponentRenderer },
|
49
93
|
],
|
50
94
|
}]
|
51
95
|
}] });
|
52
96
|
|
53
|
-
|
54
|
-
* @module
|
55
|
-
* @description
|
56
|
-
* Entry point for all public APIs of the platform-browser/testing package.
|
57
|
-
*/
|
58
|
-
|
59
|
-
/// <reference types="jasmine" />
|
60
|
-
|
61
|
-
// This file is not used to build this module. It is only used during editing
|
62
|
-
|
63
|
-
/**
|
64
|
-
* Generated bundle index. Do not edit.
|
65
|
-
*/
|
66
|
-
|
67
|
-
export { BrowserTestingModule, platformBrowserTesting };
|
97
|
+
export { BrowserTestingModule, platformBrowserTesting, DOMTestComponentRenderer as ɵDOMTestComponentRenderer };
|
68
98
|
//# sourceMappingURL=testing.mjs.map
|
package/fesm2022/testing.mjs.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"testing.mjs","sources":["../../../../../../packages/platform-browser/testing/src/
|
1
|
+
{"version":3,"file":"testing.mjs","sources":["../../../../../../packages/platform-browser/testing/src/dom_test_component_renderer.ts","../../../../../../packages/platform-browser/testing/src/browser.ts"],"sourcesContent":["/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {DOCUMENT, ɵgetDOM as getDOM} from '@angular/common';\nimport {Inject, Injectable} from '@angular/core';\nimport {TestComponentRenderer} from '@angular/core/testing';\n\n/**\n * A DOM based implementation of the TestComponentRenderer.\n */\n@Injectable()\nexport class DOMTestComponentRenderer extends TestComponentRenderer {\n constructor(@Inject(DOCUMENT) private _doc: any) {\n super();\n }\n\n override insertRootElement(rootElId: string) {\n this.removeAllRootElementsImpl();\n const rootElement = getDOM().getDefaultDocument().createElement('div');\n rootElement.setAttribute('id', rootElId);\n this._doc.body.appendChild(rootElement);\n }\n\n override removeAllRootElements() {\n // Check whether the `DOCUMENT` instance retrieved from DI contains\n // the necessary function to complete the cleanup. In tests that don't\n // interact with DOM, the `DOCUMENT` might be mocked and some functions\n // might be missing. For such tests, DOM cleanup is not required and\n // we skip the logic if there are missing functions.\n if (typeof this._doc.querySelectorAll === 'function') {\n this.removeAllRootElementsImpl();\n }\n }\n\n private removeAllRootElementsImpl() {\n const oldRoots = this._doc.querySelectorAll('[id^=root]');\n for (let i = 0; i < oldRoots.length; i++) {\n getDOM().remove(oldRoots[i]);\n }\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\nimport {PlatformLocation} from '@angular/common';\nimport {MockPlatformLocation} from '@angular/common/testing';\nimport {\n APP_ID,\n createPlatformFactory,\n NgModule,\n PLATFORM_INITIALIZER,\n platformCore,\n StaticProvider,\n ɵinternalProvideZoneChangeDetection as internalProvideZoneChangeDetection,\n ɵChangeDetectionScheduler as ChangeDetectionScheduler,\n ɵChangeDetectionSchedulerImpl as ChangeDetectionSchedulerImpl,\n} from '@angular/core';\nimport {TestComponentRenderer} from '@angular/core/testing';\nimport {BrowserModule, ɵBrowserDomAdapter as BrowserDomAdapter} from '@angular/platform-browser';\nimport {DOMTestComponentRenderer} from './dom_test_component_renderer';\n\nfunction initBrowserTests() {\n BrowserDomAdapter.makeCurrent();\n}\n\nconst _TEST_BROWSER_PLATFORM_PROVIDERS: StaticProvider[] = [\n {provide: PLATFORM_INITIALIZER, useValue: initBrowserTests, multi: true},\n];\n\n/**\n * Platform for testing\n *\n * @publicApi\n */\nexport const platformBrowserTesting = createPlatformFactory(\n platformCore,\n 'browserTesting',\n _TEST_BROWSER_PLATFORM_PROVIDERS,\n);\n\n/**\n * NgModule for testing.\n *\n * @publicApi\n */\n@NgModule({\n exports: [BrowserModule],\n providers: [\n {provide: APP_ID, useValue: 'a'},\n internalProvideZoneChangeDetection({}),\n {provide: ChangeDetectionScheduler, useExisting: ChangeDetectionSchedulerImpl},\n {provide: PlatformLocation, useClass: MockPlatformLocation},\n {provide: TestComponentRenderer, useClass: DOMTestComponentRenderer},\n ],\n})\nexport class BrowserTestingModule {}\n"],"names":["getDOM","BrowserDomAdapter","internalProvideZoneChangeDetection","ChangeDetectionScheduler","ChangeDetectionSchedulerImpl"],"mappings":";;;;;;;;;;;;;AAYA;;AAEG;AAEG,MAAO,wBAAyB,SAAQ,qBAAqB,CAAA;AAC3B,IAAA,IAAA;AAAtC,IAAA,WAAA,CAAsC,IAAS,EAAA;AAC7C,QAAA,KAAK,EAAE;QAD6B,IAAI,CAAA,IAAA,GAAJ,IAAI;;AAIjC,IAAA,iBAAiB,CAAC,QAAgB,EAAA;QACzC,IAAI,CAAC,yBAAyB,EAAE;AAChC,QAAA,MAAM,WAAW,GAAGA,OAAM,EAAE,CAAC,kBAAkB,EAAE,CAAC,aAAa,CAAC,KAAK,CAAC;AACtE,QAAA,WAAW,CAAC,YAAY,CAAC,IAAI,EAAE,QAAQ,CAAC;QACxC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC,WAAW,CAAC;;IAGhC,qBAAqB,GAAA;;;;;;QAM5B,IAAI,OAAO,IAAI,CAAC,IAAI,CAAC,gBAAgB,KAAK,UAAU,EAAE;YACpD,IAAI,CAAC,yBAAyB,EAAE;;;IAI5B,yBAAyB,GAAA;QAC/B,MAAM,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC,gBAAgB,CAAC,YAAY,CAAC;AACzD,QAAA,K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