Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
k-genov committed Nov 25, 2024
1 parent 2f04d38 commit 7cf06b9
Showing 1 changed file with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -191,10 +191,10 @@ describe('Bounding Client Rect Signal', () => {
@Component({
selector: 'spec-component',
template: `
@if (observeViewChild === 'testee-1') {
@if (observeViewChild() === 'testee-1') {
<div class="testee-1" #testee #testee_1></div>
}
@if (observeViewChild === 'testee-2') {
@if (observeViewChild() === 'testee-2') {
<div class="testee-2" #testee #testee_2></div>
}
`,
Expand All @@ -219,7 +219,7 @@ describe('Bounding Client Rect Signal', () => {
`,
})
class TestComponent {
public observeViewChild: 'testee-1' | 'testee-2' | 'none' = 'none';
public observeViewChild = signal<'testee-1' | 'testee-2' | 'none'>('none');
public testee = viewChild<ElementRef<HTMLElement>>('testee');
public boundingBox = boundingClientRect(this.testee);

Expand All @@ -238,7 +238,7 @@ describe('Bounding Client Rect Signal', () => {
expect(boundingBox()).toBeUndefined();

// Observe testee 1.
fixture.componentInstance.observeViewChild = 'testee-1';
fixture.componentInstance.observeViewChild.set('testee-1');
await waitForSignalChange(fixture.componentInstance.boundingBox);

// Expect bounding box.
Expand All @@ -256,7 +256,7 @@ describe('Bounding Client Rect Signal', () => {
}));

// Observe testee 2.
fixture.componentInstance.observeViewChild = 'testee-2';
fixture.componentInstance.observeViewChild.set('testee-2');
await waitForSignalChange(fixture.componentInstance.boundingBox);

// Expect bounding box.
Expand All @@ -274,7 +274,7 @@ describe('Bounding Client Rect Signal', () => {
}));

// Unobserve view child.
fixture.componentInstance.observeViewChild = 'none';
fixture.componentInstance.observeViewChild.set('none');
await waitForSignalChange(boundingBox);

// Expect bounding box to be undefined.
Expand Down

0 comments on commit 7cf06b9

Please sign in to comment.