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

feat(cb2-14690): version number #1636

Merged
merged 4 commits into from
Nov 8, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
@@ -1,6 +1,7 @@
import { DebugElement } from '@angular/core';
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { By } from '@angular/platform-browser';
import packageInfo from '../../../../../../package.json';
import { HeaderComponent } from '../header.component';

describe('HeaderComponent', () => {
Expand Down Expand Up @@ -42,4 +43,8 @@ describe('HeaderComponent', () => {

logOutButton.triggerEventHandler('click', null);
});
it('getAppVersion returns correct version', () => {
const version = component.getAppVersion();
expect(version).toBe(packageInfo.version);
});
});
1 change: 1 addition & 0 deletions src/app/core/components/header/header.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
<div class="govuk-grid-row govuk-!-margin-bottom-2 govuk-width-container">
<div class="govuk-grid-column-one-half">
<a href="/" id="header-home-link" class="govuk-header__link govuk-header__link--homepage">Vehicle testing management</a>
<span id="appversion">{{ getAppVersion() }}</span>
tomevs88 marked this conversation as resolved.
Show resolved Hide resolved
</div>
<div class="govuk-grid-column-one-half govuk-!-text-align-right govuk-!-font-size-19">
<span id="username">{{ username }}</span>
Expand Down
5 changes: 5 additions & 0 deletions src/app/core/components/header/header.component.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { Component, EventEmitter, Input, Output } from '@angular/core';
import packageInfo from '../../../../../package.json';

@Component({
selector: 'app-header',
Expand All @@ -12,4 +13,8 @@ export class HeaderComponent {
logout() {
this.logOutEvent.emit();
}

getAppVersion() {
return packageInfo.version;
}
tomevs88 marked this conversation as resolved.
Show resolved Hide resolved
}
Loading