Skip to content

Commit

Permalink
GMS-181 Unit test fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
peter-szrnka committed Dec 13, 2024
1 parent 859d48f commit 1aee5e4
Show file tree
Hide file tree
Showing 13 changed files with 37 additions and 35 deletions.
2 changes: 0 additions & 2 deletions code/gms-frontend/src/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import { AppComponent } from './app.component';
// Material Modules
import { MAT_SNACK_BAR_DEFAULT_OPTIONS } from '@angular/material/snack-bar';
import { AngularMaterialModule } from './angular-material-module';
import { GmsComponentsModule } from './common/components/gms-components-module';
import { AuthInterceptor } from './common/interceptor/auth-interceptor';
import { MockInterceptor } from './common/interceptor/mock-interceptor';
import { ServiceModule } from './common/service/service-module';
Expand Down Expand Up @@ -51,7 +50,6 @@ export const ENV_CONFIG = new InjectionToken('gmsEnvConfig');
// or after 30 seconds (whichever comes first).
registrationStrategy: 'registerWhenStable:30000'
}),
GmsComponentsModule,
// Main application modules
NavMenuModule,
HomeModule,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,16 @@ import { InfoDialog } from "./info-dialog/info-dialog.component";
import { MomentPipe } from "./pipes/date-formatter.pipe";
import { NavButtonVisibilityPipe } from "./pipes/nav-button-visibility.pipe";
import { TranslatorModule } from "./pipes/translator/translator.module";
import { InformationMessageComponent } from "./information-message/information-message.component";

/**
* @author Peter Szrnka
*/
@NgModule({
declarations: [
ConfirmDeleteDialog, InfoDialog, InformationMessageComponent
ConfirmDeleteDialog, InfoDialog
],
exports: [
ConfirmDeleteDialog, InfoDialog, InformationMessageComponent
ConfirmDeleteDialog, InfoDialog
],
schemas: [CUSTOM_ELEMENTS_SCHEMA, NO_ERRORS_SCHEMA],
imports: [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@ describe('InformationMessageComponent', () => {

beforeEach(() => {
TestBed.configureTestingModule({
imports : [MatDialogModule, TranslatorModule ],
declarations : [InformationMessageComponent],
imports : [MatDialogModule, TranslatorModule, InformationMessageComponent ],
schemas : [CUSTOM_ELEMENTS_SCHEMA, NO_ERRORS_SCHEMA],
providers: [
]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import { NgClass } from "@angular/common";
import { Component, Input, OnInit } from "@angular/core";
import { MatIconModule } from "@angular/material/icon";

const SETTINGS_MAP: any = {
'success': { icon: 'check_circle', iconColor: 'green', styleClass: 'success' },
Expand All @@ -10,7 +12,8 @@ const SETTINGS_MAP: any = {
* @author Peter Szrnka
*/
@Component({

standalone: true,
imports: [MatIconModule, NgClass],
selector: 'information-message',
templateUrl: './information-message.component.html',
styleUrls: ['./information-message.component.scss']
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,16 @@ import { FormsModule } from "@angular/forms";
import { BrowserModule } from "@angular/platform-browser";
import { AngularMaterialModule } from "../../angular-material-module";
import { AppRoutingModule } from "../../app-routing.module";
import { InformationMessageComponent } from "../../common/components/information-message/information-message.component";
import { NavBackComponent } from "../../common/components/nav-back/nav-back.component";
import { MomentPipe } from "../../common/components/pipes/date-formatter.pipe";
import { NavButtonVisibilityPipe } from "../../common/components/pipes/nav-button-visibility.pipe";
import { TranslatorModule } from "../../common/components/pipes/translator/translator.module";
import { AnnouncementDetailComponent } from "./announcement-detail.component";
import { AnnouncementListComponent } from "./announcement-list.component";
import { AnnouncementDetailResolver } from "./resolver/announcement-detail.resolver";
import { AnnouncementListResolver } from "./resolver/announcement-list.resolver";
import { AnnouncementService } from "./service/announcement-service";
import { TranslatorModule } from "../../common/components/pipes/translator/translator.module";
import { GmsComponentsModule } from "../../common/components/gms-components-module";

/**
* @author Peter Szrnka
Expand All @@ -29,8 +29,8 @@ import { GmsComponentsModule } from "../../common/components/gms-components-modu
MomentPipe,
NavBackComponent,
NavButtonVisibilityPipe,
TranslatorModule,
GmsComponentsModule
InformationMessageComponent,
TranslatorModule
], providers: [
AnnouncementService, AnnouncementListResolver, AnnouncementDetailResolver,
provideHttpClient(withInterceptorsFromDi())
Expand Down
6 changes: 3 additions & 3 deletions code/gms-frontend/src/app/components/help/help.compontent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@ import { ArrayDataSource } from "@angular/cdk/collections";
import { Component, OnInit } from "@angular/core";
import { ActivatedRoute } from "@angular/router";
import { AngularMaterialModule } from "../../angular-material-module";
import { ErrorCode } from "./model/error-code.model";
import { InformationMessageComponent } from "../../common/components/information-message/information-message.component";
import { TranslatorModule } from "../../common/components/pipes/translator/translator.module";
import { GmsComponentsModule } from "../../common/components/gms-components-module";
import { ErrorCode } from "./model/error-code.model";

/**
* @author Peter Szrnka
*/
@Component({
standalone: true,
imports: [ AngularMaterialModule, TranslatorModule, GmsComponentsModule ],
imports: [ AngularMaterialModule, TranslatorModule, InformationMessageComponent ],
selector: 'help',
templateUrl: './help.component.html',
styleUrls: ['./help.component.scss']
Expand Down
6 changes: 3 additions & 3 deletions code/gms-frontend/src/app/components/home/home-module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ import { BrowserModule } from "@angular/platform-browser";
import { BrowserAnimationsModule } from "@angular/platform-browser/animations";
import { AngularMaterialModule } from "../../angular-material-module";
import { AppRoutingModule } from "../../app-routing.module";
import { InformationMessageComponent } from "../../common/components/information-message/information-message.component";
import { MomentPipe } from "../../common/components/pipes/date-formatter.pipe";
import { TranslatorModule } from "../../common/components/pipes/translator/translator.module";
import { HomeComponent } from "./home.component";
import { HomeService } from "./service/home.service";
import { TranslatorModule } from "../../common/components/pipes/translator/translator.module";
import { GmsComponentsModule } from "../../common/components/gms-components-module";

/**
* @author Peter Szrnka
Expand All @@ -21,7 +21,7 @@ import { GmsComponentsModule } from "../../common/components/gms-components-modu
BrowserAnimationsModule,
AppRoutingModule,
MomentPipe,
GmsComponentsModule,
InformationMessageComponent,
TranslatorModule
], providers: [HomeService, provideHttpClient(withInterceptorsFromDi())] })
export class HomeModule { }
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@ import { MatTableDataSource } from "@angular/material/table";
import { ActivatedRoute, Router } from "@angular/router";
import { catchError, Observable } from "rxjs";
import { AngularMaterialModule } from "../../angular-material-module";
import { GmsComponentsModule } from "../../common/components/gms-components-module";
import { InformationMessageComponent } from "../../common/components/information-message/information-message.component";
import { NavBackComponent } from "../../common/components/nav-back/nav-back.component";
import { MomentPipe } from "../../common/components/pipes/date-formatter.pipe";
import { TranslatorModule } from "../../common/components/pipes/translator/translator.module";
import { SharedDataService } from "../../common/service/shared-data-service";
import { TranslatorService } from "../../common/service/translator-service";
import { JobDetail } from "./model/job-detail.model";
import { JobDetailService } from "./service/job-detail.service";
import { TranslatorModule } from "../../common/components/pipes/translator/translator.module";

const MANUAL_JOB_EXECUTION_CONFIG = [
{ label: 'job.button.event.maintenance', url : 'event_maintenance' },
Expand All @@ -29,7 +29,7 @@ const MANUAL_JOB_EXECUTION_CONFIG = [
*/
@Component({
standalone: true,
imports: [AngularMaterialModule, CommonModule, NavBackComponent, MomentPipe, TranslatorModule, GmsComponentsModule],
imports: [AngularMaterialModule, CommonModule, NavBackComponent, MomentPipe, TranslatorModule, InformationMessageComponent],
selector: 'job-detail-list',
templateUrl: './job-detail-list.component.html'
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,16 @@ import { AppRoutingModule } from "../../app-routing.module";
import { NavBackComponent } from "../../common/components/nav-back/nav-back.component";
import { MomentPipe } from "../../common/components/pipes/date-formatter.pipe";
import { NavButtonVisibilityPipe } from "../../common/components/pipes/nav-button-visibility.pipe";
import { TranslatorModule } from "../../common/components/pipes/translator/translator.module";
import { SplashComponent } from "../../common/components/splash/splash.component";
import { StatusToggleComponent } from "../../common/components/status-toggle/status-toggle.component";
import { ClipboardService } from "../../common/service/clipboard-service";
import { DialogService } from "../../common/service/dialog-service";
import { ServiceModule } from "../../common/service/service-module";
import { SharedDataService } from "../../common/service/shared-data-service";
import { User } from "../user/model/user.model";
import { COPY_SECRET_ID_MESSAGE, SecretListComponent } from "./secret-list.component";
import { SecretService } from "./service/secret-service";
import { DialogService } from "../../common/service/dialog-service";
import { TranslatorModule } from "../../common/components/pipes/translator/translator.module";

/**
* @author Peter Szrnka
Expand Down Expand Up @@ -53,7 +53,8 @@ describe('SecretListComponent', () => {
NavButtonVisibilityPipe,
StatusToggleComponent,
ServiceModule,
TranslatorModule ],
TranslatorModule
],
declarations : [SecretListComponent],
schemas : [CUSTOM_ELEMENTS_SCHEMA, NO_ERRORS_SCHEMA],
providers: [
Expand Down
4 changes: 3 additions & 1 deletion code/gms-frontend/src/app/components/secret/secret-module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ import { FormsModule } from "@angular/forms";
import { BrowserModule } from "@angular/platform-browser";
import { AngularMaterialModule } from "../../angular-material-module";
import { AppRoutingModule } from "../../app-routing.module";
import { InformationMessageComponent } from "../../common/components/information-message/information-message.component";
import { NavBackComponent } from "../../common/components/nav-back/nav-back.component";
import { MomentPipe } from "../../common/components/pipes/date-formatter.pipe";
import { NavButtonVisibilityPipe } from "../../common/components/pipes/nav-button-visibility.pipe";
import { TranslatorModule } from "../../common/components/pipes/translator/translator.module";
import { SplashComponent } from "../../common/components/splash/splash.component";
Expand All @@ -14,7 +16,6 @@ import { SecretListResolver } from "./resolver/secret-list.resolver";
import { SecretDetailComponent } from "./secret-detail.component";
import { SecretListComponent } from "./secret-list.component";
import { SecretService } from "./service/secret-service";
import { MomentPipe } from "../../common/components/pipes/date-formatter.pipe";

/**
* @author Peter Szrnka
Expand All @@ -33,6 +34,7 @@ import { MomentPipe } from "../../common/components/pipes/date-formatter.pipe";
MomentPipe,
NavButtonVisibilityPipe,
StatusToggleComponent,
InformationMessageComponent,
TranslatorModule
],
providers: [
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { provideHttpClient, withInterceptorsFromDi } from "@angular/common/http";
import { NgModule, CUSTOM_ELEMENTS_SCHEMA } from "@angular/core";
import { CUSTOM_ELEMENTS_SCHEMA, NgModule } from "@angular/core";
import { FormsModule } from "@angular/forms";
import { BrowserModule } from "@angular/platform-browser";
import { AngularMaterialModule } from "../../angular-material-module";
import { AppRoutingModule } from "../../app-routing.module";
import { SettingsSummaryComponent } from "./settings-summary.component";
import { InformationMessageComponent } from "../../common/components/information-message/information-message.component";
import { TranslatorModule } from "../../common/components/pipes/translator/translator.module";
import { GmsComponentsModule } from "../../common/components/gms-components-module";
import { SettingsSummaryComponent } from "./settings-summary.component";

/**
* @author Peter Szrnka
Expand All @@ -18,7 +18,7 @@ import { GmsComponentsModule } from "../../common/components/gms-components-modu
FormsModule,
BrowserModule,
AppRoutingModule,
TranslatorModule, GmsComponentsModule], providers: [
TranslatorModule, InformationMessageComponent], providers: [
provideHttpClient(withInterceptorsFromDi())
] })
export class SettingsModule {}
6 changes: 3 additions & 3 deletions code/gms-frontend/src/app/components/user/user-module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,17 @@ import { FormsModule } from "@angular/forms";
import { BrowserModule } from "@angular/platform-browser";
import { AngularMaterialModule } from "../../angular-material-module";
import { AppRoutingModule } from "../../app-routing.module";
import { InformationMessageComponent } from "../../common/components/information-message/information-message.component";
import { NavBackComponent } from "../../common/components/nav-back/nav-back.component";
import { MomentPipe } from "../../common/components/pipes/date-formatter.pipe";
import { TranslatorModule } from "../../common/components/pipes/translator/translator.module";
import { SplashComponent } from "../../common/components/splash/splash.component";
import { StatusToggleComponent } from "../../common/components/status-toggle/status-toggle.component";
import { UserDetailResolver } from "./resolver/user-detail.resolver";
import { UserListResolver } from "./resolver/user-list.resolver";
import { UserService } from "./service/user-service";
import { UserDetailComponent } from "./user-detail.component";
import { UserListComponent } from "./user-list.component";
import { TranslatorModule } from "../../common/components/pipes/translator/translator.module";
import { GmsComponentsModule } from "../../common/components/gms-components-module";

/**
* @author Peter Szrnka
Expand All @@ -31,7 +31,7 @@ import { GmsComponentsModule } from "../../common/components/gms-components-modu
MomentPipe,
NavBackComponent,
StatusToggleComponent,
TranslatorModule, GmsComponentsModule],
TranslatorModule, InformationMessageComponent],
providers: [
UserService, UserListResolver, UserDetailResolver,
provideHttpClient(withInterceptorsFromDi())
Expand Down
6 changes: 3 additions & 3 deletions code/gms-frontend/src/app/components/verify/verify-module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ import { BrowserModule } from "@angular/platform-browser";
import { BrowserAnimationsModule } from "@angular/platform-browser/animations";
import { AngularMaterialModule } from "../../angular-material-module";
import { AppRoutingModule } from "../../app-routing.module";
import { VerifyComponent } from "./verify.component";
import { InformationMessageComponent } from "../../common/components/information-message/information-message.component";
import { TranslatorModule } from "../../common/components/pipes/translator/translator.module";
import { GmsComponentsModule } from "../../common/components/gms-components-module";
import { VerifyComponent } from "./verify.component";

/**
* @author Peter Szrnka
Expand All @@ -20,6 +20,6 @@ import { GmsComponentsModule } from "../../common/components/gms-components-modu
BrowserAnimationsModule,
AppRoutingModule,
FormsModule,
GmsComponentsModule,
InformationMessageComponent,
TranslatorModule], providers: [provideHttpClient(withInterceptorsFromDi())] })
export class VerifyModule { }

0 comments on commit 1aee5e4

Please sign in to comment.