Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
griest024 committed Oct 11, 2024
1 parent 5cd13a2 commit d07fead
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions apps/demo/src/app/newsletter/newsletter.component.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import {
TestBed,
} from '@angular/core/testing';
import { ReactiveFormsModule } from '@angular/forms';
import { By } from '@angular/platform-browser';

import { DaffContainerModule } from '@daffodil/design/container';
import {
Expand Down Expand Up @@ -52,7 +53,7 @@ describe('NewsletterComponent', () => {
facade.success$.next(false);
fixture.detectChanges();

newsletterElement = fixture.debugElement.nativeElement.querySelector('.demo-newsletter__right');
newsletterElement = fixture.debugElement.query(By.css('.demo-newsletter__right'));
});

it('should render class .demo-newsletter__right', () => {
Expand Down Expand Up @@ -114,7 +115,7 @@ describe('NewsletterComponent', () => {
beforeEach(() => {
facade.loading$.next(false);
facade.success$.next(false);
facade.error$.next({ code: 'code', message: 'message' });
facade.error$.next([{ code: 'code', message: 'message' }]);
fixture.detectChanges();

newsletterElement = fixture.debugElement.nativeElement.querySelector('.demo-newsletter__retry');
Expand Down
2 changes: 1 addition & 1 deletion apps/demo/src/app/newsletter/newsletter.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export class NewsletterComponent implements OnInit {

ngOnInit() {
this.hasError$ = this.error$.pipe(
map(error => !!error),
map(error => error.length > 0),
);
}

Expand Down

0 comments on commit d07fead

Please sign in to comment.