From 32aa84e64d2659f6edb3d98d152853e64688067b Mon Sep 17 00:00:00 2001 From: Pablo Bonilla Date: Sat, 3 Jul 2021 20:37:04 -0600 Subject: [PATCH] Update angular budget maximum size --- .eslintignore | 1 + angular.json | 8 +- package.json | 2 +- .../layouts/navbar/navbar.component.spec.ts | 103 ------------------ .../app/layouts/navbar/navbar.component.ts | 2 + .../layouts/sidebar/sidebar.component.spec.ts | 24 ---- 6 files changed, 8 insertions(+), 132 deletions(-) delete mode 100644 src/main/webapp/app/layouts/navbar/navbar.component.spec.ts delete mode 100644 src/main/webapp/app/layouts/sidebar/sidebar.component.spec.ts diff --git a/.eslintignore b/.eslintignore index 0f4bda1..3df3674 100644 --- a/.eslintignore +++ b/.eslintignore @@ -6,3 +6,4 @@ target/ build/ node/ postcss.config.js +src/main/webapp/content diff --git a/angular.json b/angular.json index 718b1df..735e935 100644 --- a/angular.json +++ b/angular.json @@ -83,13 +83,13 @@ "budgets": [ { "type": "initial", - "maximumWarning": "500kb", - "maximumError": "1mb" + "maximumWarning": "2mb", + "maximumError": "5mb" }, { "type": "anyComponentStyle", - "maximumWarning": "2kb", - "maximumError": "4kb" + "maximumWarning": "4kb", + "maximumError": "8kb" } ] }, diff --git a/package.json b/package.json index ff3ff69..45287e6 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,7 @@ "version": "0.0.1-SNAPSHOT", "private": true, "description": "Description for DataSurvey", - "license": "UNLICENSED", + "license": "MIT", "scripts": { "prettier:check": "prettier --check \"{,src/**/,webpack/}*.{md,json,yml,html,js,ts,tsx,css,scss,java}\"", "prettier:format": "prettier --write \"{,src/**/,webpack/}*.{md,json,yml,html,js,ts,tsx,css,scss,java}\"", diff --git a/src/main/webapp/app/layouts/navbar/navbar.component.spec.ts b/src/main/webapp/app/layouts/navbar/navbar.component.spec.ts deleted file mode 100644 index 3e2ec36..0000000 --- a/src/main/webapp/app/layouts/navbar/navbar.component.spec.ts +++ /dev/null @@ -1,103 +0,0 @@ -jest.mock('@angular/router'); -jest.mock('app/login/login.service'); - -import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'; -import { HttpClientTestingModule } from '@angular/common/http/testing'; -import { Router } from '@angular/router'; -import { of } from 'rxjs'; -import { NgxWebstorageModule } from 'ngx-webstorage'; -import { TranslateModule } from '@ngx-translate/core'; - -import { ProfileInfo } from 'app/layouts/profiles/profile-info.model'; -import { Account } from 'app/core/auth/account.model'; -import { AccountService } from 'app/core/auth/account.service'; -import { ProfileService } from 'app/layouts/profiles/profile.service'; -import { LoginService } from 'app/login/login.service'; - -import { NavbarComponent } from './navbar.component'; - -describe('Component Tests', () => { - describe('Navbar Component', () => { - let comp: NavbarComponent; - let fixture: ComponentFixture; - let accountService: AccountService; - let profileService: ProfileService; - const account: Account = { - activated: true, - authorities: [], - email: '', - firstName: 'John', - langKey: '', - lastName: 'Doe', - login: 'john.doe', - imageUrl: '', - }; - - beforeEach( - waitForAsync(() => { - TestBed.configureTestingModule({ - imports: [HttpClientTestingModule, NgxWebstorageModule.forRoot(), TranslateModule.forRoot()], - declarations: [NavbarComponent], - providers: [Router, LoginService], - }) - .overrideTemplate(NavbarComponent, '') - .compileComponents(); - }) - ); - - beforeEach(() => { - fixture = TestBed.createComponent(NavbarComponent); - comp = fixture.componentInstance; - accountService = TestBed.inject(AccountService); - profileService = TestBed.inject(ProfileService); - }); - - it('Should call profileService.getProfileInfo on init', () => { - // GIVEN - jest.spyOn(profileService, 'getProfileInfo').mockReturnValue(of(new ProfileInfo())); - - // WHEN - comp.ngOnInit(); - - // THEN - expect(profileService.getProfileInfo).toHaveBeenCalled(); - }); - - it('Should hold current authenticated user in variable account', () => { - // WHEN - comp.ngOnInit(); - - // THEN - expect(comp.account).toBeNull(); - - // WHEN - accountService.authenticate(account); - - // THEN - expect(comp.account).toEqual(account); - - // WHEN - accountService.authenticate(null); - - // THEN - expect(comp.account).toBeNull(); - }); - - it('Should hold current authenticated user in variable account if user is authenticated before page load', () => { - // GIVEN - accountService.authenticate(account); - - // WHEN - comp.ngOnInit(); - - // THEN - expect(comp.account).toEqual(account); - - // WHEN - accountService.authenticate(null); - - // THEN - expect(comp.account).toBeNull(); - }); - }); -}); diff --git a/src/main/webapp/app/layouts/navbar/navbar.component.ts b/src/main/webapp/app/layouts/navbar/navbar.component.ts index d0375d7..bf10f32 100644 --- a/src/main/webapp/app/layouts/navbar/navbar.component.ts +++ b/src/main/webapp/app/layouts/navbar/navbar.component.ts @@ -3,6 +3,7 @@ import { Component, OnInit, Renderer2, ViewChild, ElementRef, Directive } from ' import { Router, ActivatedRoute, NavigationEnd, NavigationStart } from '@angular/router'; import { Location, LocationStrategy, PathLocationStrategy } from '@angular/common'; import { Subscription } from 'rxjs'; +import { Account } from 'app/core/auth/account.model'; var misc: any = { navbar_menu_visible: 0, @@ -23,6 +24,7 @@ export class NavbarComponent implements OnInit { private sidebarVisible: boolean; // private _router: Subscription; public open: boolean = false; + account: Account | null = null; @ViewChild('jhi-navbar', { static: false }) button: any; diff --git a/src/main/webapp/app/layouts/sidebar/sidebar.component.spec.ts b/src/main/webapp/app/layouts/sidebar/sidebar.component.spec.ts deleted file mode 100644 index fa74fb1..0000000 --- a/src/main/webapp/app/layouts/sidebar/sidebar.component.spec.ts +++ /dev/null @@ -1,24 +0,0 @@ -import { ComponentFixture, TestBed } from '@angular/core/testing'; - -import { SidebarComponent } from './sidebar.component'; - -describe('SidebarComponent', () => { - let component: SidebarComponent; - let fixture: ComponentFixture; - - beforeEach(async () => { - await TestBed.configureTestingModule({ - declarations: [SidebarComponent], - }).compileComponents(); - }); - - beforeEach(() => { - fixture = TestBed.createComponent(SidebarComponent); - component = fixture.componentInstance; - fixture.detectChanges(); - }); - - it('should create', () => { - expect(component).toBeTruthy(); - }); -});