Skip to content

Commit

Permalink
Merge pull request #1536 from rodekruis/fix.control-flow
Browse files Browse the repository at this point in the history
fix.control flow
  • Loading branch information
arsforza authored Aug 1, 2024
2 parents 1c14c5e + 9a310be commit 06884f8
Show file tree
Hide file tree
Showing 97 changed files with 2,217 additions and 2,180 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!DOCTYPE html>
<!doctype html>
<html>
<head>
<meta charset="utf-8" />
Expand Down
35 changes: 24 additions & 11 deletions interfaces/IBF-dashboard/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions interfaces/IBF-dashboard/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,8 @@
"karma-coverage-istanbul-reporter": "^3.0.3",
"karma-jasmine": "^5.1.0",
"karma-jasmine-html-reporter": "^2.1.0",
"prettier": "2.2.1",
"prettier-plugin-organize-imports": "^2.3.4",
"prettier": "^3.3.3",
"prettier-plugin-organize-imports": "^4.0.0",
"typescript": "^5.4.5",
"xlsx": "^0.17.5"
}
Expand Down
4 changes: 1 addition & 3 deletions interfaces/IBF-dashboard/prettier.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@ module.exports = {
overrides: [
{
files: '*.html',
options: {
parser: 'angular',
},
options: { parser: 'angular' },
},
],
};
8 changes: 5 additions & 3 deletions interfaces/IBF-dashboard/src/app/app.component.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
<ion-app>
<div class="loader" *ngIf="loading" data-test="loader">
<ion-spinner color="light"></ion-spinner>
</div>
@if (loading) {
<div class="loader" data-test="loader">
<ion-spinner color="light"></ion-spinner>
</div>
}
<ion-router-outlet></ion-router-outlet>
</ion-app>
26 changes: 12 additions & 14 deletions interfaces/IBF-dashboard/src/app/app.component.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,19 @@ describe('AppComponent', () => {
let platformReadySpy;
let platformSpy;

beforeEach(
waitForAsync(() => {
platformReadySpy = Promise.resolve();
platformSpy = jasmine.createSpyObj('Platform', {
ready: platformReadySpy,
});
beforeEach(waitForAsync(() => {
platformReadySpy = Promise.resolve();
platformSpy = jasmine.createSpyObj('Platform', {
ready: platformReadySpy,
});

TestBed.configureTestingModule({
declarations: [AppComponent],
imports: [TranslateModule.forRoot()],
schemas: [CUSTOM_ELEMENTS_SCHEMA],
providers: [{ provide: Platform, useValue: platformSpy }],
}).compileComponents();
}),
);
TestBed.configureTestingModule({
declarations: [AppComponent],
imports: [TranslateModule.forRoot()],
schemas: [CUSTOM_ELEMENTS_SCHEMA],
providers: [{ provide: Platform, useValue: platformSpy }],
}).compileComponents();
}));

it('should create the app', () => {
const fixture = TestBed.createComponent(AppComponent);
Expand Down
5 changes: 4 additions & 1 deletion interfaces/IBF-dashboard/src/app/auth/auth.guard.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,10 @@ import { AuthService } from './auth.service';
providedIn: 'root',
})
export class AuthGuard {
constructor(private router: Router, private authService: AuthService) {}
constructor(
private router: Router,
private authService: AuthService,
) {}

canActivate(
next: ActivatedRouteSnapshot,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,22 +12,20 @@ describe('AboutBtnComponent', () => {
let component: AboutBtnComponent;
let fixture: ComponentFixture<AboutBtnComponent>;

beforeEach(
waitForAsync(() => {
TestBed.configureTestingModule({
declarations: [AboutBtnComponent],
imports: [IonicModule, RouterTestingModule],
providers: [
provideHttpClient(withInterceptorsFromDi()),
provideHttpClientTesting(),
],
}).compileComponents();
beforeEach(waitForAsync(() => {
TestBed.configureTestingModule({
declarations: [AboutBtnComponent],
imports: [IonicModule, RouterTestingModule],
providers: [
provideHttpClient(withInterceptorsFromDi()),
provideHttpClientTesting(),
],
}).compileComponents();

fixture = TestBed.createComponent(AboutBtnComponent);
component = fixture.componentInstance;
fixture.detectChanges();
}),
);
fixture = TestBed.createComponent(AboutBtnComponent);
component = fixture.componentInstance;
fixture.detectChanges();
}));

it('should create', () => {
expect(component).toBeTruthy();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,11 @@ export class AboutBtnComponent implements OnDestroy {

private onDisasterTypeChange = (disasterType: DisasterType) => {
this.disasterType = disasterType;
this.countryDisasterSettings = this.disasterTypeService.getCountryDisasterTypeSettings(
this.country,
this.disasterType,
);
this.countryDisasterSettings =
this.disasterTypeService.getCountryDisasterTypeSettings(
this.country,
this.disasterType,
);
};

public btnAction() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,16 @@ describe('ActionResultPopoverComponent', () => {
let component: ActionResultPopoverComponent;
let fixture: ComponentFixture<ActionResultPopoverComponent>;

beforeEach(
waitForAsync(() => {
TestBed.configureTestingModule({
declarations: [ActionResultPopoverComponent],
imports: [IonicModule.forRoot(), TranslateModule.forRoot()],
}).compileComponents();
beforeEach(waitForAsync(() => {
TestBed.configureTestingModule({
declarations: [ActionResultPopoverComponent],
imports: [IonicModule.forRoot(), TranslateModule.forRoot()],
}).compileComponents();

fixture = TestBed.createComponent(ActionResultPopoverComponent);
component = fixture.componentInstance;
fixture.detectChanges();
}),
);
fixture = TestBed.createComponent(ActionResultPopoverComponent);
component = fixture.componentInstance;
fixture.detectChanges();
}));

// disabling this test as it fails because of the 'setTimeout' in the .ts file.
xit('should create', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,26 +13,24 @@ describe('ActivationLogButtonComponent', () => {
let component: ActivationLogButtonComponent;
let fixture: ComponentFixture<ActivationLogButtonComponent>;

beforeEach(
waitForAsync(() => {
TestBed.configureTestingModule({
declarations: [ActivationLogButtonComponent],
imports: [
IonicModule.forRoot(),
RouterTestingModule,
TranslateModule.forRoot(),
],
providers: [
provideHttpClient(withInterceptorsFromDi()),
provideHttpClientTesting(),
],
}).compileComponents();
beforeEach(waitForAsync(() => {
TestBed.configureTestingModule({
declarations: [ActivationLogButtonComponent],
imports: [
IonicModule.forRoot(),
RouterTestingModule,
TranslateModule.forRoot(),
],
providers: [
provideHttpClient(withInterceptorsFromDi()),
provideHttpClientTesting(),
],
}).compileComponents();

fixture = TestBed.createComponent(ActivationLogButtonComponent);
component = fixture.componentInstance;
fixture.detectChanges();
}),
);
fixture = TestBed.createComponent(ActivationLogButtonComponent);
component = fixture.componentInstance;
fixture.detectChanges();
}));

it('should create', () => {
expect(component).toBeTruthy();
Expand Down
Loading

0 comments on commit 06884f8

Please sign in to comment.