Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update f3x step 3 unit tests #310

Merged
merged 1 commit into from
May 26, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ import { selectCommitteeAccount } from 'app/store/committee-account.selectors';
import { selectUserLoginData } from 'app/store/login.selectors';
import { ConfirmationService, MessageService } from 'primeng/api';
import { of } from 'rxjs';
import { ToolbarModule } from 'primeng/toolbar';
import { TableModule } from 'primeng/table';
import { RouterTestingModule } from '@angular/router/testing';

import { CreateF3xStep3Component } from './create-f3x-step3.component';

Expand All @@ -26,6 +29,7 @@ describe('CreateF3xStep4Component', () => {
token: 'jwttokenstring',
};
await TestBed.configureTestingModule({
imports: [ToolbarModule, TableModule, RouterTestingModule],
declarations: [CreateF3xStep3Component],
providers: [
MessageService,
Expand All @@ -50,6 +54,7 @@ describe('CreateF3xStep4Component', () => {
transaction_type_identifier: 'OFFSET_TO_OPEX',
})
),
getTableData: () => of([]),
},
},
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
import { Component, ElementRef, OnInit, Pipe, PipeTransform } from '@angular/core';
import { ActivatedRoute } from '@angular/router';
import { Observable } from 'rxjs';
import { Store } from '@ngrx/store';
import { refreshCommitteeAccountDetailsAction } from '../../../store/committee-account.actions';
import { selectCommitteeAccount } from 'app/store/committee-account.selectors';
import { F3xSummary } from 'app/shared/models/f3x-summary.model';
import { CommitteeAccount } from 'app/shared/models/committee-account.model';
import { TableListBaseComponent } from 'app/shared/components/table-list-base/table-list-base.component';
import { Transaction } from 'app/shared/interfaces/transaction.interface';
import { ConfirmationService, MessageService } from 'primeng/api';
Expand All @@ -17,24 +12,20 @@ import { TransactionService } from 'app/shared/services/transaction.service';
})
export class CreateF3xStep3Component extends TableListBaseComponent<Transaction> implements OnInit {
report: F3xSummary | undefined;
committeeAccount$: Observable<CommitteeAccount> = this.store.select(selectCommitteeAccount);

constructor(
protected override messageService: MessageService,
protected override confirmationService: ConfirmationService,
protected override elementRef: ElementRef,
protected override itemService: TransactionService,
private activatedRoute: ActivatedRoute,
private store: Store
) {
super(messageService, confirmationService, elementRef);
}

ngOnInit(): void {
// Refresh committee account details whenever page loads
this.store.dispatch(refreshCommitteeAccountDetailsAction());

this.report = this.activatedRoute.snapshot.data['report'];
this.loading = true;
}

protected getEmptyItem(): Transaction {
Expand Down