Skip to content

Commit

Permalink
Merge branch 'hotfix/v0.10.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
musicEnfanthen committed Feb 25, 2023
2 parents afdeca0 + eb2d7af commit fa535a0
Show file tree
Hide file tree
Showing 23 changed files with 680 additions and 810 deletions.
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,20 @@

All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.

### [0.10.1](https://github.com/webern-unibas-ch/awg-app/compare/v0.10.0...v0.10.1) (2023-02-25)


### Bug Fixes

* **assets:** fix id for M 317 Textfassung 1 ([6b83e07](https://github.com/webern-unibas-ch/awg-app/commit/6b83e07bbbac72348dbe6121bc22a4af08b92570))
* **edition:** fix queryParams for sheet ids ([d44404b](https://github.com/webern-unibas-ch/awg-app/commit/d44404be3ce949591bc20932180fa993c0fb9ab1))
* **home:** add M 30 to start page ([c041593](https://github.com/webern-unibas-ch/awg-app/commit/c041593b6d425391d42c00fce24c99c081a64e1d))


### Tests

* **app:** fix tests for routerLinks ([1500e94](https://github.com/webern-unibas-ch/awg-app/commit/1500e947a9f1197f3ffe34cb64ea326dcb78091c))

## [0.10.0](https://github.com/webern-unibas-ch/awg-app/compare/v0.9.3...v0.10.0) (2023-02-25)


Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "awg-app",
"version": "0.10.0",
"version": "0.10.1",
"license": "MIT",
"author": {
"name": "Stefan Münnich",
Expand Down
4 changes: 2 additions & 2 deletions src/app/app.globals.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
// THIS IS AN AUTO-GENERATED FILE. DO NOT CHANGE IT MANUALLY!
// Generated last time on Sat, Feb 25, 2023 3:21:11 PM
// Generated last time on Sat, Feb 25, 2023 8:25:53 PM

/**
* The latest version of the AWG App
*/
export const appVersion = '0.10.0';
export const appVersion = '0.10.1';

/**
* The release date of the latest version of the AWG App
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,12 +116,22 @@ describe('FooterDeclarationComponent (DONE)', () => {
routerLinks = linkDes.map(de => de.injector.get(RouterLinkStubDirective));
});

it('... can get routerLinks from template', () => {
it('... can get correct number of routerLinks from template', () => {
expect(routerLinks.length).withContext('should have 2 routerLinks').toBe(2);
});

it('... can get correct linkParams from template', () => {
expect(routerLinks[0].linkParams).withContext(`should equal ['/contact']`).toEqual(['/contact']);
expect(routerLinks[1].linkParams).withContext(`should equal ['/contact']`).toEqual(['/contact']);
});

it('... can get correct fragments from template', () => {
expect(routerLinks[0].fragment).withContext(`should be 'awg-imprint'`).toBe('awg-imprint');
expect(routerLinks[1].fragment)
.withContext(`should be 'awg-documentation'`)
.toEqual('awg-documentation');
});

it('... can click imprint link in template', () => {
const imprintLinkDe = linkDes[0]; // Contact link DebugElement
const imprintLink = routerLinks[0]; // Contact link directive
Expand All @@ -132,6 +142,7 @@ describe('FooterDeclarationComponent (DONE)', () => {
fixture.detectChanges();

expect(imprintLink.navigatedTo).withContext(`should equal ['/contact']`).toEqual(['/contact']);
expect(imprintLink.navigatedToFragment).withContext(`should be 'awg-imprint'`).toEqual('awg-imprint');
});

it('... can click documentation link in template', () => {
Expand All @@ -144,6 +155,9 @@ describe('FooterDeclarationComponent (DONE)', () => {
fixture.detectChanges();

expect(documentationLink.navigatedTo).withContext(`should equal ['/contact']`).toEqual(['/contact']);
expect(documentationLink.navigatedToFragment)
.withContext(`should be 'awg-documentation'`)
.toEqual('awg-documentation');
});
});
});
Expand Down
175 changes: 43 additions & 132 deletions src/app/core/navbar/navbar.component.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -554,7 +554,7 @@ describe('NavbarComponent (DONE)', () => {
);

// Expect header and 3 dropdown items for each dropdown complex
divDe.forEach((complexDe, index) => {
divDe.forEach(complexDe => {
getAndExpectDebugElementByCss(complexDe, 'h6.dropdown-header', 1, 1);
getAndExpectDebugElementByCss(complexDe, 'a.dropdown-item', 3, 3);
});
Expand Down Expand Up @@ -667,154 +667,65 @@ describe('NavbarComponent (DONE)', () => {
});

describe('[routerLink]', () => {
let expectedOrderOfRouterlinks: string[][];

beforeEach(() => {
// Find DebugElements with an attached RouterLinkStubDirective
linkDes = getAndExpectDebugElementByDirective(compDe, RouterLinkStubDirective, 18, 18);

// Get attached link directive instances using each DebugElement's injector
routerLinks = linkDes.map(de => de.injector.get(RouterLinkStubDirective));
});

it('... can get 18 routerLinks from template', () => {
expect(routerLinks.length).withContext('should have 18 routerLinks').toBe(18);
});

it('... can get correct routes from routerLinks', () => {
expect(routerLinks[0].linkParams).withContext(`should equal ['/home']`).toEqual(['/home']);

expect(routerLinks[1].linkParams)
.withContext(
`should equal ${[
expectedEditionRouteConstants.EDITION.route,
expectedEditionRouteConstants.SERIES.route,
]}`
)
.toEqual([expectedEditionRouteConstants.EDITION.route, expectedEditionRouteConstants.SERIES.route]);

expect(routerLinks[2].linkParams)
.withContext(
`should equal ${[
expectedEditionRouteConstants.EDITION.route,
expectedEditionRouteConstants.ROWTABLES.route,
]}`
)
.toEqual([
expectedEditionRouteConstants.EDITION.route,
expectedEditionRouteConstants.ROWTABLES.route,
]);

let routerLinkIndex = 3;
expectedEditionComplexes.forEach(complex => {
expect(routerLinks[routerLinkIndex].linkParams)
.withContext(
`should equal ${[complex.baseRoute, expectedEditionRouteConstants.EDITION_INTRO.route]}`
)
.toEqual([complex.baseRoute, expectedEditionRouteConstants.EDITION_INTRO.route]);

expect(routerLinks[routerLinkIndex + 1].linkParams)
.withContext(
`should equal ${[complex.baseRoute, expectedEditionRouteConstants.EDITION_SHEETS.route]}`
)
.toEqual([complex.baseRoute, expectedEditionRouteConstants.EDITION_SHEETS.route]);

expect(routerLinks[routerLinkIndex + 2].linkParams)
.withContext(
`should equal ${[complex.baseRoute, expectedEditionRouteConstants.EDITION_REPORT.route]}`
)
.toEqual([complex.baseRoute, expectedEditionRouteConstants.EDITION_REPORT.route]);

routerLinkIndex += 3;
});

expect(routerLinks[routerLinkIndex].linkParams)
.withContext(`should equal ['/structure']`)
.toEqual(['/structure']);

expect(routerLinks[routerLinkIndex + 1].linkParams)
.withContext(`should equal ['/data']`)
.toEqual(['/data']);

expect(routerLinks[routerLinkIndex + 2].linkParams)
.withContext(`should equal ['/contact']`)
.toEqual(['/contact']);
});

it('... can click Home link in template', () => {
const homeLinkDe = linkDes[0]; // Home link DebugElement
const homeLink = routerLinks[0]; // Home link directive

const expectedRoute = ['/home'];

expect(homeLink.navigatedTo).withContext('should not have navigated yet').toBeNull();

click(homeLinkDe);
fixture.detectChanges();

expect(homeLink.navigatedTo).toBeTruthy();
expect(homeLink.navigatedTo).withContext(`should equal ${expectedRoute}`).toEqual(expectedRoute);
});

it('... can click Edition link in template', () => {
const editionLinkDe = linkDes[3]; // Edition link DebugElement
const editionLink = routerLinks[3]; // Edition link directive

const expectedRoute = [
expectedSelectedEditionComplex.baseRoute,
expectedEditionRouteConstants.EDITION_INTRO.route,
expectedOrderOfRouterlinks = [
['/home'],
[expectedEditionRouteConstants.EDITION.route, expectedEditionRouteConstants.SERIES.route],
[expectedEditionRouteConstants.EDITION.route, expectedEditionRouteConstants.ROWTABLES.route],
[expectedEditionComplexes[0].baseRoute, expectedEditionRouteConstants.EDITION_INTRO.route],
[expectedEditionComplexes[0].baseRoute, expectedEditionRouteConstants.EDITION_SHEETS.route],
[expectedEditionComplexes[0].baseRoute, expectedEditionRouteConstants.EDITION_REPORT.route],
[expectedEditionComplexes[1].baseRoute, expectedEditionRouteConstants.EDITION_INTRO.route],
[expectedEditionComplexes[1].baseRoute, expectedEditionRouteConstants.EDITION_SHEETS.route],
[expectedEditionComplexes[1].baseRoute, expectedEditionRouteConstants.EDITION_REPORT.route],
[expectedEditionComplexes[2].baseRoute, expectedEditionRouteConstants.EDITION_INTRO.route],
[expectedEditionComplexes[2].baseRoute, expectedEditionRouteConstants.EDITION_SHEETS.route],
[expectedEditionComplexes[2].baseRoute, expectedEditionRouteConstants.EDITION_REPORT.route],
[expectedEditionComplexes[3].baseRoute, expectedEditionRouteConstants.EDITION_INTRO.route],
[expectedEditionComplexes[3].baseRoute, expectedEditionRouteConstants.EDITION_SHEETS.route],
[expectedEditionComplexes[3].baseRoute, expectedEditionRouteConstants.EDITION_REPORT.route],
['/structure'],
['/data'],
['/contact'],
];

expect(editionLink.navigatedTo).withContext('should not have navigated yet').toBeNull();

click(editionLinkDe);
fixture.detectChanges();

expect(editionLink.navigatedTo).toBeTruthy();
expect(editionLink.navigatedTo).withContext(`should equal ${expectedRoute}`).toEqual(expectedRoute);
});

it('... can click Structure link in template', () => {
const structureLinkDe = linkDes[15]; // Structure link DebugElement
const structureLink = routerLinks[15]; // Structure link directive

const expectedRoute = ['/structure'];

expect(structureLink.navigatedTo).withContext('should not have navigated yet').toBeNull();

click(structureLinkDe);
fixture.detectChanges();

expect(structureLink.navigatedTo).toBeTruthy();
expect(structureLink.navigatedTo).withContext(`should equal ${expectedRoute}`).toEqual(expectedRoute);
it('... can get correct numer of routerLinks from template', () => {
expect(routerLinks.length)
.withContext(`should have ${expectedOrderOfRouterlinks.length} routerLinks`)
.toBe(expectedOrderOfRouterlinks.length);
});

it('... can click Data link in template', () => {
const dataLinkDe = linkDes[16]; // Data link DebugElement
const dataLink = routerLinks[16]; // Data link directive

const expectedRoute = ['/data'];

expect(dataLink.navigatedTo).withContext('should not have navigated yet').toBeNull();

click(dataLinkDe);
fixture.detectChanges();

expect(dataLink.navigatedTo).toBeTruthy();
expect(dataLink.navigatedTo).withContext(`should equal ${expectedRoute}`).toEqual(expectedRoute);
it('... can get correct linkParams from template', () => {
routerLinks.forEach((routerLink, index) => {
expect(routerLink.linkParams)
.withContext(`should equal ${expectedOrderOfRouterlinks[index]}`)
.toEqual(expectedOrderOfRouterlinks[index]);
});
});

it('... can click Contact link in template', () => {
const contactLinkDe = linkDes[17]; // Contact link DebugElement
const contactLink = routerLinks[17]; // Contact link directive

const expectedRoute = ['/contact'];
it('... can click all links in template', () => {
routerLinks.forEach((routerLink, index) => {
const linkDe = linkDes[index];
const expectedRouterLink = expectedOrderOfRouterlinks[index];

expect(contactLink.navigatedTo).withContext('should not have navigated yet').toBeNull();
expect(routerLink.navigatedTo).toBeNull();

click(contactLinkDe);
fixture.detectChanges();
click(linkDe);
fixture.detectChanges();

expect(contactLink.navigatedTo).toBeTruthy();
expect(contactLink.navigatedTo).withContext(`should equal ${expectedRoute}`).toEqual(expectedRoute);
expect(routerLink.navigatedTo)
.withContext(`should equal ${expectedRouterLink}`)
.toEqual(expectedRouterLink);
});
});
});
});
Expand Down
Loading

0 comments on commit fa535a0

Please sign in to comment.