Skip to content

Commit

Permalink
fixing unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
Snehasish authored and Snehasish committed Dec 19, 2024
1 parent 2562483 commit a5f53d0
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
3 changes: 2 additions & 1 deletion src/app/fyle/my-view-report/my-view-report.page.html
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@
<div class="view-reports--zero-state-semibold-header">Looks like you’ve got</div>
<div class="view-reports--zero-state-header">0 expense right now</div>
</div>
<div class="view-reports--footer-conatiner">
<div class="view-reports--footer-container">
<button
*ngIf="unreportedExpenses && unreportedExpenses.length > 0"
class="btn-primary"
Expand All @@ -186,6 +186,7 @@
</button>
<button
class="btn-outline-secondary"
id="add-expense"
[ngClass]="{'btn-primary': !(unreportedExpenses && unreportedExpenses.length > 0), 'btn-outline-secondary': unreportedExpenses && unreportedExpenses.length > 0}"
(click)="addExpense()"
>
Expand Down
2 changes: 1 addition & 1 deletion src/app/fyle/my-view-report/my-view-report.page.scss
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
}
}

&--footer-conatiner {
&--footer-container {
display: flex;
justify-content: space-between;
padding: 16px;
Expand Down
4 changes: 1 addition & 3 deletions src/app/fyle/my-view-report/my-view-report.page.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -930,9 +930,7 @@ describe('MyViewReportPage', () => {
component.report$ = of(cloneDeep({ ...platformReportData, state: 'DRAFT' }));
fixture.detectChanges();

const addExpenseButton = fixture.debugElement.nativeElement.querySelector(
'.view-reports--footer-conatiner .btn-outline-secondary'
) as HTMLElement;
const addExpenseButton = getElementBySelector(fixture, '#add-expense') as HTMLElement;
click(addExpenseButton);

expect(router.navigate).toHaveBeenCalledOnceWith([
Expand Down

0 comments on commit a5f53d0

Please sign in to comment.