Skip to content

Commit

Permalink
Update dependencies and fix linter
Browse files Browse the repository at this point in the history
  • Loading branch information
Allcharles committed Mar 18, 2021
1 parent 0067db0 commit 2131539
Show file tree
Hide file tree
Showing 7 changed files with 1,970 additions and 3,229 deletions.
1 change: 0 additions & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@
}
],
"@angular-eslint/use-component-view-encapsulation": "error",
"@angular-eslint/use-pipe-decorator": "error",
"@typescript-eslint/await-thenable": "error",
"@typescript-eslint/consistent-type-definitions": "error",
"@typescript-eslint/dot-notation": "off",
Expand Down
5,036 changes: 1,896 additions & 3,140 deletions package-lock.json

Large diffs are not rendered by default.

84 changes: 42 additions & 42 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,25 +30,25 @@
},
"private": true,
"dependencies": {
"@angular/animations": "^11.1.0",
"@angular/cdk": "^11.2.2",
"@angular/common": "^11.1.0",
"@angular/compiler": "^11.1.0",
"@angular/core": "^11.1.0",
"@angular/forms": "^11.1.0",
"@angular/google-maps": "^11.2.2",
"@angular/localize": "^11.1.0",
"@angular/platform-browser": "^11.1.0",
"@angular/platform-browser-dynamic": "^11.1.0",
"@angular/platform-server": "^11.1.0",
"@angular/router": "^11.1.0",
"@angular/animations": "^11.2.6",
"@angular/cdk": "^11.2.5",
"@angular/common": "^11.2.6",
"@angular/compiler": "^11.2.6",
"@angular/core": "^11.2.6",
"@angular/forms": "^11.2.6",
"@angular/google-maps": "^11.2.5",
"@angular/localize": "^11.2.6",
"@angular/platform-browser": "^11.2.6",
"@angular/platform-browser-dynamic": "^11.2.6",
"@angular/platform-server": "^11.2.6",
"@angular/router": "^11.2.6",
"@fortawesome/angular-fontawesome": "^0.8.2",
"@fortawesome/fontawesome-svg-core": "^1.2.34",
"@fortawesome/free-solid-svg-icons": "^5.15.2",
"@fortawesome/fontawesome-svg-core": "^1.2.35",
"@fortawesome/free-solid-svg-icons": "^5.15.3",
"@ng-bootstrap/ng-bootstrap": "^9.0.2",
"@nguniversal/express-engine": "^11.1.0",
"@ngx-formly/bootstrap": "^5.10.12",
"@ngx-formly/core": "^5.10.12",
"@nguniversal/express-engine": "^11.2.1",
"@ngx-formly/bootstrap": "^5.10.15",
"@ngx-formly/core": "^5.10.15",
"@ngx-loading-bar/core": "^5.1.1",
"@ngx-loading-bar/http-client": "^5.1.1",
"@swimlane/ngx-datatable": "^19.0.0",
Expand All @@ -66,48 +66,48 @@
"ng-recaptcha3": "^1.3.1",
"ngx-cookie-service": "^11.0.2",
"ngx-device-detector": "^2.0.6",
"ngx-line-truncation": "^1.6.7",
"ngx-toastr": "^13.2.0",
"ngx-line-truncation": "^1.6.8",
"ngx-toastr": "^13.2.1",
"rxjs": "^6.6.6",
"snazzy-info-window": "^1.1.1",
"tslib": "^2.1.0",
"zone.js": "^0.11.4"
},
"devDependencies": {
"@angular-devkit/build-angular": "^0.1102.2",
"@angular-eslint/builder": "1.2.0",
"@angular-eslint/eslint-plugin": "1.2.0",
"@angular-eslint/eslint-plugin-template": "1.2.0",
"@angular-eslint/schematics": "^1.2.0",
"@angular-eslint/template-parser": "1.2.0",
"@angular/cli": "^11.2.2",
"@angular/compiler-cli": "^11.1.0",
"@angular/language-service": "^11.2.3",
"@angular-devkit/build-angular": "^0.1102.5",
"@angular-eslint/builder": "2.0.2",
"@angular-eslint/eslint-plugin": "2.0.2",
"@angular-eslint/eslint-plugin-template": "2.0.2",
"@angular-eslint/schematics": "2.0.2",
"@angular-eslint/template-parser": "2.0.2",
"@angular/cli": "^11.2.5",
"@angular/compiler-cli": "^11.2.6",
"@angular/language-service": "^11.2.6",
"@chiragrupani/karma-chromium-edge-launcher": "^2.1.0",
"@ngneat/spectator": "^7.0.0",
"@nguniversal/builders": "^11.2.0",
"@nrwl/nx-cloud": "^11.1.4",
"@nrwl/workspace": "^11.2.12",
"@ngneat/spectator": "^7.1.0",
"@nguniversal/builders": "^11.2.1",
"@nrwl/nx-cloud": "^11.2.0",
"@nrwl/workspace": "11.5.1",
"@types/express": "^4.17.11",
"@types/faker": "^5.1.7",
"@types/jasmine": "^3.6.4",
"@types/jasmine": "^3.6.7",
"@types/jasminewd2": "^2.0.8",
"@types/luxon": "^1.26.1",
"@types/node": "^14.14.31",
"@typescript-eslint/eslint-plugin": "4.15.2",
"@types/luxon": "^1.26.2",
"@types/node": "^14.14.35",
"@typescript-eslint/eslint-plugin": "4.18.0",
"@typescript-eslint/parser": "^4.18.0",
"codelyzer": "^6.0.1",
"eslint": "^7.21.0",
"eslint": "^7.22.0",
"eslint-plugin-import": "2.22.1",
"eslint-plugin-jsdoc": "32.2.0",
"eslint-plugin-jsdoc": "32.3.0",
"eslint-plugin-prefer-arrow": "1.2.3",
"eslint-plugin-rxjs": "latest",
"eslint-plugin-rxjs-angular": "^1.0.4",
"faker": "^5.4.0",
"jasmine-core": "^3.6.0",
"jasmine-core": "^3.7.0",
"jasmine-reporters": "^2.3.2",
"jasmine-spec-reporter": "^6.0.0",
"karma": "^6.1.1",
"karma": "^6.2.0",
"karma-chrome-launcher": "^3.1.0",
"karma-coverage": "^2.0.3",
"karma-firefox-launcher": "^2.1.0",
Expand All @@ -117,10 +117,10 @@
"karma-mocha-reporter": "^2.2.5",
"karma-opera-launcher": "^1.0.0",
"karma-viewport": "^1.0.8",
"ng-mocks": "^11.9.0",
"ng-mocks": "^11.9.1",
"protractor": "^7.0.0",
"ts-node": "^9.1.1",
"typescript": "^4.1.5",
"typescript": "^4.2.3",
"webpack-bundle-analyzer": "^4.4.0"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -396,28 +396,28 @@ describe("ProjectDetailsComponent", () => {
},
].forEach(({ test, isSite, list, stateTracker, createModels }) => {
describe(test, () => {
it(`should create initial ${test} api filter request`, async (done) => {
it(`should create initial ${test} api filter request`, (done) => {
setup(defaultProject);
const expectation = (filters, project) => {
expect(project).toEqual(defaultProject.id);
expect(filters).toEqual({ paging: { page: 1 }, filter: {} });
done();
};
await handleOnInit(isSite, [expectation]);
handleOnInit(isSite, [expectation]);
});

it(`should create paged ${test} api filter request`, async (done) => {
it(`should create paged ${test} api filter request`, (done) => {
setup(defaultProject);
const expectation = (filters, project) => {
expect(project).toEqual(defaultProject.id);
expect(filters).toEqual({ paging: { page: 5 }, filter: {} });
done();
};
await handleOnInit(isSite, [initialExpectation, expectation], 5);
handleOnInit(isSite, [initialExpectation, expectation], 5);
});

if (isSite) {
it("should handle site api filter request with regionId", async (done) => {
it("should handle site api filter request with regionId", (done) => {
const spy = jasmine.createSpy();
setup(defaultProject);
component["generateFilter"] = spy.and.callFake(() => ({
Expand All @@ -431,10 +431,10 @@ describe("ProjectDetailsComponent", () => {
});
done();
};
await handleOnInit(isSite, [initialExpectation, expectation], 1);
handleOnInit(isSite, [initialExpectation, expectation], 1);
});

it("should not override site api filter request with regionId", async (done) => {
it("should not override site api filter request with regionId", (done) => {
setup(defaultProject);
const expectation = (filters) => {
expect(filters).toEqual({
Expand All @@ -443,7 +443,7 @@ describe("ProjectDetailsComponent", () => {
});
done();
};
await handleOnInit(
handleOnInit(
isSite,
[initialExpectation, expectation],
5,
Expand Down
12 changes: 5 additions & 7 deletions src/app/components/shared/cms/cms.component.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { DomSanitizer, SafeHtml } from "@angular/platform-browser";
import { SafeHtml } from "@angular/platform-browser";
import { RouterTestingModule } from "@angular/router/testing";
import { ApiErrorDetails } from "@baw-api/api.interceptor.service";
import { MockBawApiModule } from "@baw-api/baw-apiMock.module";
Expand Down Expand Up @@ -44,24 +44,22 @@ describe("CmsComponent", () => {
cmsService = spectator.inject(CmsService);
});

it("should request page from api", async (done) => {
const promise = interceptApiRequest("page content", undefined, (page) => {
it("should request page from api", (done) => {
interceptApiRequest("page content", undefined, (page) => {
expect(page).toBe(CMS.home);
done();
});
spectator.setInput("page", CMS.home);
spectator.detectChanges();
await promise;
});

it("should change request based on page", async (done) => {
const promise = interceptApiRequest("page content", undefined, (page) => {
it("should change request based on page", (done) => {
interceptApiRequest("page content", undefined, (page) => {
expect(page).toBe(CMS.credits);
done();
});
spectator.setInput("page", CMS.credits);
spectator.detectChanges();
await promise;
});

it("should initially display loading animation", () => {
Expand Down
28 changes: 11 additions & 17 deletions src/app/components/sites/site/site.component.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -368,37 +368,31 @@ describe("SiteComponent", () => {
});

describe("filterByDates", () => {
it("should request list of newest audio recordings", async (done) => {
it("should request list of newest audio recordings", (done) => {
setup(defaultProject, defaultSite);
interceptEventsRequest();
const promise = interceptRecordingsRequest([], (filter, site) => {
interceptRecordingsRequest([], (filter, site) => {
expect(filter).toEqual({
sorting: { orderBy: "recordedDate", direction: "desc" },
});
expect(site).toEqual(defaultSite);
done();
});
spec.detectChanges();
await promise;
});

it("should request list of oldest audio recordings", async (done) => {
it("should request list of oldest audio recordings", (done) => {
setup(defaultProject, defaultSite);
interceptEventsRequest();
const promise = interceptRecordingsRequest(
[],
undefined,
(filter, site) => {
expect(filter).toEqual({
sorting: { orderBy: "recordedDate", direction: "asc" },
paging: { items: 1 },
});
expect(site).toEqual(defaultSite);
done();
}
);
interceptRecordingsRequest([], undefined, (filter, site) => {
expect(filter).toEqual({
sorting: { orderBy: "recordedDate", direction: "asc" },
paging: { items: 1 },
});
expect(site).toEqual(defaultSite);
done();
});
spec.detectChanges();
await promise;
});

it("should make two requests", async () => {
Expand Down
22 changes: 8 additions & 14 deletions src/app/services/baw-api/security/security.service.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,7 @@ describe("SecurityService", () => {
);
});

it("should handle getFormData throwing error", async (done) => {
it("should handle getFormData throwing error", (done) => {
interceptDataRequest();
handleAuth({
getFormData: () => {
Expand All @@ -409,18 +409,16 @@ describe("SecurityService", () => {
done();
},
});
await initialRequests;
});

it("should handle formDataRequest failure", async (done) => {
it("should handle formDataRequest failure", (done) => {
interceptDataRequest(defaultError);
handleAuth({
error: (err: ApiErrorDetails) => {
expect(err).toEqual(defaultError);
done();
},
});
await initialRequests;
});
});

Expand Down Expand Up @@ -455,15 +453,14 @@ describe("SecurityService", () => {
expect(argument).toContain("/security/user?antiCache=" + timestamp);
});

it("should handle session user details failure", async (done) => {
it("should handle session user details failure", (done) => {
interceptSessionUser(undefined, defaultError);
handleAuth({
error: (err: ApiErrorDetails) => {
expect(err).toEqual(defaultError);
done();
},
});
await initialRequests;
});
});

Expand All @@ -485,15 +482,14 @@ describe("SecurityService", () => {
expect(userApi.show).toHaveBeenCalled();
});

it("should handle user details failure", async (done) => {
it("should handle user details failure", (done) => {
interceptUser(undefined, defaultError);
handleAuth({
error: (err: ApiErrorDetails) => {
expect(err).toEqual(defaultError);
done();
},
});
await initialRequests;
});
});

Expand Down Expand Up @@ -530,28 +526,26 @@ describe("SecurityService", () => {
expect(trigger.next).toHaveBeenCalledTimes(1);
});

it("should call next", async (done) => {
const promise = interceptRequests();
it("should call next", (done) => {
interceptRequests();
handleAuth({
next: () => {
expect(true).toBeTrue();
done();
},
error: shouldNotFail,
});
await promise;
});

it("should complete observable", async (done) => {
const promise = interceptRequests();
it("should complete observable", (done) => {
interceptRequests();
handleAuth({
error: shouldNotFail,
complete: () => {
expect(true).toBeTrue();
done();
},
});
await promise;
});
});

Expand Down

0 comments on commit 2131539

Please sign in to comment.