Update angular budget maximum size

This commit is contained in:
Pablo Bonilla 2021-07-03 20:37:04 -06:00
parent 14349cabd4
commit 32aa84e64d
No known key found for this signature in database
GPG Key ID: 46877262B8DE47E2
6 changed files with 8 additions and 132 deletions

View File

@ -6,3 +6,4 @@ target/
build/ build/
node/ node/
postcss.config.js postcss.config.js
src/main/webapp/content

View File

@ -83,13 +83,13 @@
"budgets": [ "budgets": [
{ {
"type": "initial", "type": "initial",
"maximumWarning": "500kb", "maximumWarning": "2mb",
"maximumError": "1mb" "maximumError": "5mb"
}, },
{ {
"type": "anyComponentStyle", "type": "anyComponentStyle",
"maximumWarning": "2kb", "maximumWarning": "4kb",
"maximumError": "4kb" "maximumError": "8kb"
} }
] ]
}, },

View File

@ -3,7 +3,7 @@
"version": "0.0.1-SNAPSHOT", "version": "0.0.1-SNAPSHOT",
"private": true, "private": true,
"description": "Description for DataSurvey", "description": "Description for DataSurvey",
"license": "UNLICENSED", "license": "MIT",
"scripts": { "scripts": {
"prettier:check": "prettier --check \"{,src/**/,webpack/}*.{md,json,yml,html,js,ts,tsx,css,scss,java}\"", "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}\"", "prettier:format": "prettier --write \"{,src/**/,webpack/}*.{md,json,yml,html,js,ts,tsx,css,scss,java}\"",

View File

@ -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<NavbarComponent>;
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();
});
});
});

View File

@ -3,6 +3,7 @@ import { Component, OnInit, Renderer2, ViewChild, ElementRef, Directive } from '
import { Router, ActivatedRoute, NavigationEnd, NavigationStart } from '@angular/router'; import { Router, ActivatedRoute, NavigationEnd, NavigationStart } from '@angular/router';
import { Location, LocationStrategy, PathLocationStrategy } from '@angular/common'; import { Location, LocationStrategy, PathLocationStrategy } from '@angular/common';
import { Subscription } from 'rxjs'; import { Subscription } from 'rxjs';
import { Account } from 'app/core/auth/account.model';
var misc: any = { var misc: any = {
navbar_menu_visible: 0, navbar_menu_visible: 0,
@ -23,6 +24,7 @@ export class NavbarComponent implements OnInit {
private sidebarVisible: boolean; private sidebarVisible: boolean;
// private _router: Subscription; // private _router: Subscription;
public open: boolean = false; public open: boolean = false;
account: Account | null = null;
@ViewChild('jhi-navbar', { static: false }) button: any; @ViewChild('jhi-navbar', { static: false }) button: any;

View File

@ -1,24 +0,0 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { SidebarComponent } from './sidebar.component';
describe('SidebarComponent', () => {
let component: SidebarComponent;
let fixture: ComponentFixture<SidebarComponent>;
beforeEach(async () => {
await TestBed.configureTestingModule({
declarations: [SidebarComponent],
}).compileComponents();
});
beforeEach(() => {
fixture = TestBed.createComponent(SidebarComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});