Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 09cfd7b

Browse filesBrowse files
committed
refactor(template): updated all tests to use provideRxRenderStrategies
1 parent 5c78bbf commit 09cfd7b
Copy full SHA for 09cfd7b

25 files changed

+154
-265
lines changed

‎libs/cdk/template/spec/list-manager.spec.ts

Copy file name to clipboardExpand all lines: libs/cdk/template/spec/list-manager.spec.ts
+2-7Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import {
1313
ViewContainerRef,
1414
} from '@angular/core';
1515
import { TestBed } from '@angular/core/testing';
16-
import { RX_RENDER_STRATEGIES_CONFIG } from '@rx-angular/cdk/render-strategies';
16+
import { provideRxRenderStrategies } from '@rx-angular/cdk/render-strategies';
1717
import { RxStrategyProvider } from '@rx-angular/cdk/render-strategies';
1818
import { mockConsole } from '@test-helpers/rx-angular';
1919
import { ReplaySubject } from 'rxjs';
@@ -141,12 +141,7 @@ const setupListManagerComponent = (): void => {
141141
providers: [
142142
{ provide: ErrorHandler, useValue: customErrorHandler },
143143
ViewContainerRef,
144-
{
145-
provide: RX_RENDER_STRATEGIES_CONFIG,
146-
useValue: {
147-
primaryStrategy: 'native',
148-
},
149-
},
144+
provideRxRenderStrategies({ primaryStrategy: 'native' }),
150145
],
151146
teardown: { destroyAfterEach: true },
152147
});

‎libs/cdk/template/spec/template-manager.spec.ts

Copy file name to clipboardExpand all lines: libs/cdk/template/spec/template-manager.spec.ts
+12-15Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
import { ErrorHandler, TemplateRef, ViewContainerRef } from '@angular/core';
22
import { ComponentFixture, TestBed } from '@angular/core/testing';
33
import { RxNotificationKind } from '@rx-angular/cdk/notifications';
4-
import { RX_RENDER_STRATEGIES_CONFIG } from '@rx-angular/cdk/render-strategies';
54
import { mockConsole } from '@test-helpers/rx-angular';
65
import { of, ReplaySubject, throwError } from 'rxjs';
76
import { tap } from 'rxjs/operators';
7+
import { provideRxRenderStrategies } from '../../render-strategies/src';
88
import { RxTemplateManager } from '../src/lib/template-manager';
99
import {
1010
createTestComponent,
@@ -32,22 +32,19 @@ const setupTemplateManagerComponent = (template = DEFAULT_TEMPLATE): void => {
3232
providers: [
3333
{ provide: ErrorHandler, useValue: customErrorHandler },
3434
ViewContainerRef,
35-
{
36-
provide: RX_RENDER_STRATEGIES_CONFIG,
37-
useValue: {
38-
primaryStrategy: 'test',
39-
customStrategies: {
40-
test: {
41-
name: 'test',
42-
work: (cdRef) => cdRef.detectChanges(),
43-
behavior:
44-
({ work }) =>
45-
(o$) =>
46-
o$.pipe(tap(() => work())),
47-
},
35+
provideRxRenderStrategies({
36+
primaryStrategy: 'test',
37+
customStrategies: {
38+
test: {
39+
name: 'test',
40+
work: (cdRef) => cdRef.detectChanges(),
41+
behavior:
42+
({ work }) =>
43+
(o$) =>
44+
o$.pipe(tap(() => work())),
4845
},
4946
},
50-
},
47+
}),
5148
],
5249
teardown: { destroyAfterEach: true },
5350
});

‎libs/template/for/src/lib/tests/for.directive.observable.spec.ts

Copy file name to clipboardExpand all lines: libs/template/for/src/lib/tests/for.directive.observable.spec.ts
+2-7Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { ErrorHandler } from '@angular/core';
22
import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
33
import { By } from '@angular/platform-browser';
4-
import { RX_RENDER_STRATEGIES_CONFIG } from '@rx-angular/cdk/render-strategies';
4+
import { provideRxRenderStrategies } from '@rx-angular/cdk/render-strategies';
55
import { Observable } from 'rxjs';
66
import { provideExperimentalRxForReconciliation } from '../provide-experimental-reconciler';
77
import { provideLegacyRxForReconciliation } from '../provide-legacy-reconciler';
@@ -49,12 +49,7 @@ describe('rxFor with observables', () => {
4949
provide: ErrorHandler,
5050
useValue: customErrorHandler,
5151
},
52-
{
53-
provide: RX_RENDER_STRATEGIES_CONFIG,
54-
useValue: {
55-
primaryStrategy: 'native',
56-
},
57-
},
52+
provideRxRenderStrategies({ primaryStrategy: 'native' }),
5853
conciler === 'legacy'
5954
? provideLegacyRxForReconciliation()
6055
: provideExperimentalRxForReconciliation(),

‎libs/template/for/src/lib/tests/for.directive.signal.spec.ts

Copy file name to clipboardExpand all lines: libs/template/for/src/lib/tests/for.directive.signal.spec.ts
+2-7Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { ErrorHandler } from '@angular/core';
22
import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
33
import { By } from '@angular/platform-browser';
4-
import { RX_RENDER_STRATEGIES_CONFIG } from '@rx-angular/cdk/render-strategies';
4+
import { provideRxRenderStrategies } from '@rx-angular/cdk/render-strategies';
55
import { provideExperimentalRxForReconciliation } from '../provide-experimental-reconciler';
66
import { provideLegacyRxForReconciliation } from '../provide-legacy-reconciler';
77
import {
@@ -54,12 +54,7 @@ describe('rxFor with signals', () => {
5454
provide: ErrorHandler,
5555
useValue: customErrorHandler,
5656
},
57-
{
58-
provide: RX_RENDER_STRATEGIES_CONFIG,
59-
useValue: {
60-
primaryStrategy: 'native',
61-
},
62-
},
57+
provideRxRenderStrategies({ primaryStrategy: 'native' }),
6358
conciler === 'legacy'
6459
? provideLegacyRxForReconciliation()
6560
: provideExperimentalRxForReconciliation(),

‎libs/template/for/src/lib/tests/for.directive.spec.ts

Copy file name to clipboardExpand all lines: libs/template/for/src/lib/tests/for.directive.spec.ts
+2-7Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { ErrorHandler } from '@angular/core';
22
import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
33
import { By } from '@angular/platform-browser';
4-
import { RX_RENDER_STRATEGIES_CONFIG } from '@rx-angular/cdk/render-strategies';
4+
import { provideRxRenderStrategies } from '@rx-angular/cdk/render-strategies';
55
import { provideExperimentalRxForReconciliation } from '../provide-experimental-reconciler';
66
import { provideLegacyRxForReconciliation } from '../provide-legacy-reconciler';
77
import {
@@ -43,12 +43,7 @@ describe('rxFor', () => {
4343
provide: ErrorHandler,
4444
useValue: customErrorHandler,
4545
},
46-
{
47-
provide: RX_RENDER_STRATEGIES_CONFIG,
48-
useValue: {
49-
primaryStrategy: 'native',
50-
},
51-
},
46+
provideRxRenderStrategies({ primaryStrategy: 'native' }),
5247
conciler === 'legacy'
5348
? provideLegacyRxForReconciliation()
5449
: provideExperimentalRxForReconciliation(),

‎libs/template/if/src/lib/tests/if.directive.context-templates.spec.ts

Copy file name to clipboardExpand all lines: libs/template/if/src/lib/tests/if.directive.context-templates.spec.ts
+12-15Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import {
55
tick,
66
} from '@angular/core/testing';
77
import { RxNotificationKind } from '@rx-angular/cdk/notifications';
8-
import { RX_RENDER_STRATEGIES_CONFIG } from '@rx-angular/cdk/render-strategies';
8+
import { provideRxRenderStrategies } from '@rx-angular/cdk/render-strategies';
99
import { mockConsole } from '@test-helpers/rx-angular';
1010
import {
1111
BehaviorSubject,
@@ -52,22 +52,19 @@ const setupTestComponent = () => {
5252
TestBed.configureTestingModule({
5353
imports: [TestComponent],
5454
providers: [
55-
{
56-
provide: RX_RENDER_STRATEGIES_CONFIG,
57-
useValue: {
58-
primaryStrategy: 'urgent',
59-
customStrategies: {
60-
urgent: {
61-
name: 'urgent',
62-
work: (cdRef) => cdRef.detectChanges(),
63-
behavior:
64-
({ work }) =>
65-
(o$) =>
66-
o$.pipe(tap(() => work())),
67-
},
55+
provideRxRenderStrategies({
56+
primaryStrategy: 'urgent',
57+
customStrategies: {
58+
urgent: {
59+
name: 'urgent',
60+
work: (cdRef) => cdRef.detectChanges(),
61+
behavior:
62+
({ work }) =>
63+
(o$) =>
64+
o$.pipe(tap(() => work())),
6865
},
6966
},
70-
},
67+
}),
7168
],
7269
});
7370
};

‎libs/template/if/src/lib/tests/if.directive.context.spec.ts

Copy file name to clipboardExpand all lines: libs/template/if/src/lib/tests/if.directive.context.spec.ts
+12-15Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import {
55
tick,
66
} from '@angular/core/testing';
77
import { RxNotificationKind } from '@rx-angular/cdk/notifications';
8-
import { RX_RENDER_STRATEGIES_CONFIG } from '@rx-angular/cdk/render-strategies';
8+
import { provideRxRenderStrategies } from '@rx-angular/cdk/render-strategies';
99
import { mockConsole } from '@test-helpers/rx-angular';
1010
import {
1111
BehaviorSubject,
@@ -59,22 +59,19 @@ const setupTestComponent = () => {
5959
TestBed.configureTestingModule({
6060
imports: [TestComponent],
6161
providers: [
62-
{
63-
provide: RX_RENDER_STRATEGIES_CONFIG,
64-
useValue: {
65-
primaryStrategy: 'urgent',
66-
customStrategies: {
67-
urgent: {
68-
name: 'urgent',
69-
work: (cdRef) => cdRef.detectChanges(),
70-
behavior:
71-
({ work }) =>
72-
(o$) =>
73-
o$.pipe(tap(() => work())),
74-
},
62+
provideRxRenderStrategies({
63+
primaryStrategy: 'urgent',
64+
customStrategies: {
65+
urgent: {
66+
name: 'urgent',
67+
work: (cdRef) => cdRef.detectChanges(),
68+
behavior:
69+
({ work }) =>
70+
(o$) =>
71+
o$.pipe(tap(() => work())),
7572
},
7673
},
77-
},
74+
}),
7875
],
7976
});
8077
};

‎libs/template/if/src/lib/tests/if.directive.observable.spec.ts

Copy file name to clipboardExpand all lines: libs/template/if/src/lib/tests/if.directive.observable.spec.ts
+13-16Lines changed: 13 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
22
import { By } from '@angular/platform-browser';
3-
import { RX_RENDER_STRATEGIES_CONFIG } from '@rx-angular/cdk/render-strategies';
3+
import { provideRxRenderStrategies } from '@rx-angular/cdk/render-strategies';
44
import { BehaviorSubject, of, startWith, tap, throwError } from 'rxjs';
55
import { createTestComponent, TestComponent } from './fixtures';
66

@@ -19,24 +19,21 @@ describe('rxIf directive observable values', () => {
1919
TestBed.configureTestingModule({
2020
imports: [TestComponent],
2121
providers: [
22-
{
23-
provide: RX_RENDER_STRATEGIES_CONFIG,
24-
useValue: {
25-
primaryStrategy: 'custom',
26-
customStrategies: {
27-
custom: {
28-
name: 'custom',
29-
work: (cdRef) => {
30-
cdRef.detectChanges();
31-
},
32-
behavior:
33-
({ work }) =>
34-
(o$) =>
35-
o$.pipe(tap(() => work())),
22+
provideRxRenderStrategies({
23+
primaryStrategy: 'custom',
24+
customStrategies: {
25+
custom: {
26+
name: 'custom',
27+
work: (cdRef) => {
28+
cdRef.detectChanges();
3629
},
30+
behavior:
31+
({ work }) =>
32+
(o$) =>
33+
o$.pipe(tap(() => work())),
3734
},
3835
},
39-
},
36+
}),
4037
],
4138
});
4239
});

‎libs/template/if/src/lib/tests/if.directive.signal.spec.ts

Copy file name to clipboardExpand all lines: libs/template/if/src/lib/tests/if.directive.signal.spec.ts
+13-16Lines changed: 13 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import {
66
waitForAsync,
77
} from '@angular/core/testing';
88
import { By } from '@angular/platform-browser';
9-
import { RX_RENDER_STRATEGIES_CONFIG } from '@rx-angular/cdk/render-strategies';
9+
import { provideRxRenderStrategies } from '@rx-angular/cdk/render-strategies';
1010
import { startWith, tap, throwError } from 'rxjs';
1111
import { createTestComponent, TestComponent } from './fixtures';
1212

@@ -25,24 +25,21 @@ describe('rxIf directive signal values', () => {
2525
TestBed.configureTestingModule({
2626
imports: [TestComponent],
2727
providers: [
28-
{
29-
provide: RX_RENDER_STRATEGIES_CONFIG,
30-
useValue: {
31-
primaryStrategy: 'custom',
32-
customStrategies: {
33-
custom: {
34-
name: 'custom',
35-
work: (cdRef) => {
36-
cdRef.detectChanges();
37-
},
38-
behavior:
39-
({ work }) =>
40-
(o$) =>
41-
o$.pipe(tap(() => work())),
28+
provideRxRenderStrategies({
29+
primaryStrategy: 'custom',
30+
customStrategies: {
31+
custom: {
32+
name: 'custom',
33+
work: (cdRef) => {
34+
cdRef.detectChanges();
4235
},
36+
behavior:
37+
({ work }) =>
38+
(o$) =>
39+
o$.pipe(tap(() => work())),
4340
},
4441
},
45-
},
42+
}),
4643
],
4744
});
4845
});

‎libs/template/if/src/lib/tests/if.directive.spec.ts

Copy file name to clipboardExpand all lines: libs/template/if/src/lib/tests/if.directive.spec.ts
+2-9Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
22
import { By } from '@angular/platform-browser';
3-
import { RX_RENDER_STRATEGIES_CONFIG } from '@rx-angular/cdk/render-strategies';
3+
import { provideRxRenderStrategies } from '@rx-angular/cdk/render-strategies';
44
import { createTestComponent, TestComponent } from './fixtures';
55

66
describe('rxIf directive', () => {
@@ -17,14 +17,7 @@ describe('rxIf directive', () => {
1717
beforeEach(() => {
1818
TestBed.configureTestingModule({
1919
imports: [TestComponent],
20-
providers: [
21-
{
22-
provide: RX_RENDER_STRATEGIES_CONFIG,
23-
useValue: {
24-
primaryStrategy: 'native',
25-
},
26-
},
27-
],
20+
providers: [provideRxRenderStrategies({ primaryStrategy: 'native' })],
2821
});
2922
});
3023

‎libs/template/let/src/lib/tests/let.directive.complete.spec.ts

Copy file name to clipboardExpand all lines: libs/template/let/src/lib/tests/let.directive.complete.spec.ts
+2-7Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import {
55
ViewContainerRef,
66
} from '@angular/core';
77
import { TestBed } from '@angular/core/testing';
8-
import { RX_RENDER_STRATEGIES_CONFIG } from '@rx-angular/cdk/render-strategies';
8+
import { provideRxRenderStrategies } from '@rx-angular/cdk/render-strategies';
99
import { mockConsole } from '@test-helpers/rx-angular';
1010
import { EMPTY, Observable, of } from 'rxjs';
1111
import { RxLet } from '../let.directive';
@@ -37,12 +37,7 @@ const setupLetDirectiveTestComponentComplete = (): void => {
3737
{ provide: ChangeDetectorRef, useClass: MockChangeDetectorRef },
3838
TemplateRef,
3939
ViewContainerRef,
40-
{
41-
provide: RX_RENDER_STRATEGIES_CONFIG,
42-
useValue: {
43-
primaryStrategy: 'native',
44-
},
45-
},
40+
provideRxRenderStrategies({ primaryStrategy: 'native' }),
4641
],
4742
teardown: { destroyAfterEach: true },
4843
});

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.