Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit c18c870

Browse files
committed
test(state): ugly fix for cd not happening
1 parent dc5641a commit c18c870

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

libs/state/spec/rx-state.spec.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ describe(rxState, () => {
163163
expect(count()).toBe(2);
164164
});
165165

166-
it('should connect a signal to a key', () => {
166+
it('should connect a signal to a key', async () => {
167167
const counterInput = signal(1337);
168168
const { component, fixture } = setupComponent<{ count: number }>(
169169
({ connect }) => {
@@ -173,6 +173,8 @@ describe(rxState, () => {
173173
);
174174
const state = component.state;
175175

176+
fixture.detectChanges();
177+
// TODO @edbzn: Remove detecting changes twice when we have a better solution
176178
fixture.detectChanges();
177179

178180
expect(state.get('count')).toBe(1337);
@@ -198,6 +200,8 @@ describe(rxState, () => {
198200
);
199201
const state = component.state;
200202

203+
fixture.detectChanges();
204+
// TODO @edbzn: Remove detecting changes twice when we have a better solution
201205
fixture.detectChanges();
202206

203207
expect(state.get('count')).toBe(4);
@@ -221,6 +225,8 @@ describe(rxState, () => {
221225
);
222226
const state = component.state;
223227

228+
fixture.detectChanges();
229+
// TODO @edbzn: Remove detecting changes twice when we have a better solution
224230
fixture.detectChanges();
225231

226232
expect(state.get('count')).toBe(1337);
@@ -325,6 +331,7 @@ function setupComponent<State extends { count: number }>(
325331
});
326332

327333
const fixture = TestBed.createComponent(TestComponent);
334+
// fixture.detectChanges()
328335

329336
return {
330337
fixture,

0 commit comments

Comments
 (0)