Commit 2eb7927e authored by rajkumar's avatar rajkumar
Browse files

Update tests

parent bb4f49c2
......@@ -54,3 +54,7 @@ input[type="password"]:focus{
padding-top: 2px;
cursor: pointer;
}
input[readonly]{
background-color: #f5f5f5;
}
\ No newline at end of file
......@@ -29,7 +29,7 @@
<input matInput placeholder="Address" required [(ngModel)]="address" name="address">
</mat-form-field>
<mat-form-field class="app-field-padding">
<input matInput placeholder="Country" [matAutocomplete]="auto" name="country" #countryVal="ngModel" [(ngModel)]="country" (ngModelChange)="getCountries(country)">
<input matInput placeholder="Country" [matAutocomplete]="auto" name="country" #countryVal="ngModel" [(ngModel)]="country" (ngModelChange)="getCountries(country)" autocomplete="new-password">
</mat-form-field>
<mat-autocomplete #auto="matAutocomplete">
<mat-option *ngFor="let country of countries" [value]="country">
......@@ -43,7 +43,7 @@
</mat-form-field>
<mat-form-field class="app-field-padding">
<input matInput [disabled]="editMode" type="password" placeholder="Confirm Password" required [(ngModel)]="confirmPassword" name="confirmPassword" autocomplete="new-password">
<input matInput [disabled]="editMode" type="password" placeholder="Confirm Password" required [(ngModel)]="confirmPassword" name="confirmPassword" autocomplete="new-c-password">
<mat-error *ngIf="f.controls['confirmPassword']?.errors?.passwordMismatch">
Passwords do not match
</mat-error>
......
/*
* Copyright 2018 EMBL - European Bioinformatics Institute
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this
* file except in compliance with the License. You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software distributed under the
* License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
* CONDITIONS OF ANY KIND, either express or implied. See the License for the
* specific language governing permissions and limitations under the License.
*/
import { TestBed, async } from '@angular/core/testing';
import { RouterTestingModule } from '@angular/router/testing';
import { AppComponent } from './app.component';
describe('AppComponent', () => {
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [
AppComponent
],
imports: [
RouterTestingModule
],
}).compileComponents();
}));
it('should create the app', async(() => {
const fixture = TestBed.createComponent(AppComponent);
const app = fixture.debugElement.componentInstance;
expect(app).toBeTruthy();
}));
});
......@@ -51,7 +51,7 @@ import { ResetPasswordPageComponent } from './reset-password-page/reset-password
import { StudyManagementComponent } from './study-management/study-management.component';
import { PopupMessageComponent } from './popup-message/popup-message.component';
import { FormsModule } from '@angular/forms';
import { MatIconModule, MatCardSubtitle } from '@angular/material';
import { MatIconModule, MatCardSubtitle, MatSidenavModule } from '@angular/material';
import { FileInputValueAccessor } from './directives/file-input.accessor.directive';
import { DiableAutofillDirective } from './directives/app-disable-autofill.directive';
import { ReleaseDatePopupComponent } from './release-date-popup/release-date-popup/release-date-popup.component';
......@@ -135,6 +135,7 @@ const appRoutes: Routes = [
HttpClientModule,
FormsModule,
MatIconModule,
MatSidenavModule,
// Router
RouterModule.forRoot(
......
......@@ -21,6 +21,7 @@ import { MockWebinReportService } from '../mock/mock-webin-report.service';
import { ChecklistComponent } from './checklist.component';
import { RouterModule } from '@angular/router';
import { MockWebinRestService } from '../mock/mock-webin-rest.service';
import { HttpClientModule, HttpClient } from '@angular/common/http';
describe('ChecklistComponent', () => {
let component: ChecklistComponent;
......@@ -29,7 +30,7 @@ describe('ChecklistComponent', () => {
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ChecklistComponent],
imports: [UiModule, RouterModule.forRoot([])],
imports: [UiModule, RouterModule.forRoot([]),HttpClientModule],
providers: [
{
provide: WebinAuthenticationService,
......@@ -43,6 +44,10 @@ describe('ChecklistComponent', () => {
provide: WebinRestService,
useClass: MockWebinRestService
},
{
provide: HttpClient,
useClass: MockWebinRestService
},
]
})
.compileComponents();
......
<header id="masthead-black-bar" class="clearfix masthead-black-bar">
</header>
<div> <!-- fxHide fxShow.gt-xs> <!-- ** Application specific content: fxHide fxShow.gt-xs ** -->
<header id="masthead" class="masthead compact-for-data">
<div class="masthead-inner row expanded">
<div *ngIf="isAuthenticated()" class="homeDiv">
<mat-icon matTooltip="Dashboard" routerLink="">home</mat-icon>
</div>
<!-- local-title -->
<div class="float-left inline-block padding-left-large" id="local-title">
<a routerLink=""><h4 style="color:white">
{{getTitle()}}
</h4></a> <!-- ** Application specific content ** -->
</div>
<!-- /local-title -->
<!-- local-nav -->
<nav class="float-left columns medium-6 large-6" style="margin-top: 0;">
<ul id="local-nav" class="dropdown menu float-left" data-description="navigational">
<li><a href="https://www.ebi.ac.uk/ena/browser/support">Support <i class="icon icon-generic" data-icon="x"></i></a></li> <!-- ** Application specific content ** -->
<li *ngIf="isAuthenticated()"><a href="logout">Logout
<span >({{getAccount()}})</span> <!-- ** Application specific content ** -->
</a></li>
</ul>
</nav>
<!-- /local-nav -->
</div>
</header>
</div>
<!-- The below line is commented because it is added in sidenav-->
<!--<header id="masthead-black-bar" class="clearfix masthead-black-bar">
</header> -->
<form (ngSubmit)="login()">
<form (ngSubmit)="login()" autocomplete="off">
<div fxLayout="row" fxLayoutAlign="center center" class="login-card-container">
<mat-card class="login-card">
<mat-card-header>
......@@ -8,12 +8,12 @@
<mat-card-content>
<p>
<mat-form-field>
<input matInput placeholder="Webin submission account" required [(ngModel)]="username" name="username">
<input matInput placeholder="Webin submission account" required [(ngModel)]="username" name="username" autocomplete="new-password">
</mat-form-field>
</p>
<p>
<mat-form-field>
<input type="password" matInput placeholder="Password" required [(ngModel)]="password" name="password">
<input type="password" matInput placeholder="Password" required [(ngModel)]="password" name="password" autocomplete="new-password">
</mat-form-field>
</p>
<div style="text-align: center;">
......
input[readonly]{
background-color: #f5f5f5;
}
\ No newline at end of file
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { ReleaseDatePopupComponent } from './release-date-popup.component';
import { FormsModule } from '@angular/forms';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import { HttpClientModule } from '@angular/common/http';
import { MatFormFieldModule, MatInputModule, MatDatepicker, MatDatepickerModule, MatDialogModule, MatDialogRef, MAT_DIALOG_DATA, DateAdapter, MAT_DATE_LOCALE, MAT_DATE_FORMATS } from '@angular/material';
import { WebinAuthenticationService } from '../../webin-authentication.service';
import { WebinRestService } from '../../webin-rest.service';
import { ActivatedRoute } from '@angular/router';
import { MomentDateAdapter } from '@angular/material-moment-adapter';
import { CUSTOM_FORMATS } from '../../study-management/study-management.component';
describe('ReleaseDatePopupComponent', () => {
let component: ReleaseDatePopupComponent;
let fixture: ComponentFixture<ReleaseDatePopupComponent>;
const fakeActivatedRoute = {
snapshot: { params: {"id":123 } }
} ;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ ReleaseDatePopupComponent ]
})
declarations: [ ReleaseDatePopupComponent ],
imports:[BrowserAnimationsModule,FormsModule,HttpClientModule,MatFormFieldModule,MatInputModule,MatDatepickerModule,MatDialogModule],
providers:[WebinAuthenticationService,WebinRestService,
{provide: ActivatedRoute, useValue: fakeActivatedRoute},
{provide:MatDialogRef, useValue:{} },{ provide: MAT_DIALOG_DATA, useValue: {"contactObj":{"id":123}}},
{provide: DateAdapter, useClass: MomentDateAdapter, deps: [MAT_DATE_LOCALE]},
{provide: MAT_DATE_FORMATS, useValue: CUSTOM_FORMATS}
]
})
.compileComponents();
}));
......
......@@ -39,3 +39,8 @@ mat-form-field.mat-form-field {
vertical-align: -5px;
}
input[readonly]{
background-color:none;
}
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { SidenavComponent } from './sidenav.component';
describe('SidenavComponent', () => {
let component: SidenavComponent;
let fixture: ComponentFixture<SidenavComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ SidenavComponent ]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(SidenavComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});
......@@ -3,7 +3,6 @@ import { MediaMatcher } from '@angular/cdk/layout';
import { environment } from '../../../environments/environment';
import { WebinAuthenticationService } from '../../webin-authentication.service';
import { ReportType } from '../../report-type.enum';
import { FormControl } from '@angular/forms';
@Component({
selector: 'app-sidenav',
......@@ -20,20 +19,13 @@ export class SidenavComponent implements OnDestroy {
isShowing = true;
showSubSubMenu: boolean = true;
//private _mobileQueryListener: () => void;
constructor(private _webinAuthenticationService: WebinAuthenticationService,
changeDetectorRef: ChangeDetectorRef, media: MediaMatcher) {
this.mobileQuery = media.matchMedia('(max-width: 700px)');
//this._mobileQueryListener = () => changeDetectorRef.detectChanges();
// this.mobileQuery.addListener(this._mobileQueryListener);
}
ngOnDestroy(): void {
// this.mobileQuery.removeListener(this._mobileQueryListener);
}
getTitle() {
return environment.title;
......
......@@ -131,7 +131,7 @@
<mat-card class="mat-body" *ngIf="provideGenomeAnnotation && !isProductionEnv">
<mat-card-subtitle>Locus Tag Prefix Registration</mat-card-subtitle>
<mat-body>Locus Tag Prefix registration is disabled in non production environment.</mat-body>
<p class="mat-body">Locus Tag Prefix registration is disabled in non production environment.</p>
</mat-card>
<mat-card class="mat-body" *ngIf="provideGenomeAnnotation && isProductionEnv">
<mat-card-subtitle>Locus Tag Prefix Registration</mat-card-subtitle>
......
......@@ -22,7 +22,7 @@ describe('StudyManagementComponent', () => {
beforeEach(async(() => {
TestBed.configureTestingModule({
imports: [MatCheckboxModule,BrowserAnimationsModule, MatInputModule,MatFormFieldModule , HttpClientModule ,ObserversModule, FormsModule, MatIconModule, MatDividerModule,MatDatepickerModule, MatCardModule, MatAutocompleteModule ,MatTableModule, MatProgressSpinnerModule],
imports: [ MatCheckboxModule,BrowserAnimationsModule, MatInputModule,MatFormFieldModule , HttpClientModule ,ObserversModule, FormsModule, MatIconModule, MatDividerModule,MatDatepickerModule, MatCardModule, MatAutocompleteModule ,MatTableModule, MatProgressSpinnerModule],
declarations: [ StudyManagementComponent ],
providers:[WebinAuthenticationService,WebinRestService,
{provide: ActivatedRoute, useValue: fakeActivatedRoute},]
......
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>The European Bioinformatics Institute &lt; EMBL-EBI</title>
<meta name="description" content="EMBL-EBI Ultra-wide boilerplate page" /><!-- Describe what this page is about -->
<meta name="keywords" content="bioinformatics, europe, institute" /><!-- 3 to 10 keywords about the content of this page (not the whole project) -->
<meta name="author" content="EMBL-EBI" /><!-- Your [project-name] here -->
<meta name="HandheldFriendly" content="true" />
<meta name="MobileOptimized" content="width" />
<meta name="viewport" content="width=device-width,initial-scale=1" />
<meta name="theme-color" content="#70BDBD" /> <!-- Android Chrome mobile browser tab color -->
<!-- Get suggested SEO and social metatags at:
https://www.ebi.ac.uk/style-lab/websites/patterns/meta-copy.html -->
<!-- Add information on the life cycle of this page -->
<meta name="ebi:owner" content="John Doe" /> <!-- Who should be contacted about changes -->
<meta name="ebi:review-cycle" content="30" /> <!-- In days, how often should the content be reviewed -->
<meta name="ebi:last-review" content="2015-12-20" /> <!-- The last time the content was reviewed -->
<meta name="ebi:expiry" content="2016-01-20" /> <!-- When this content is no longer relevant -->
<!-- If you link to any other sites frequently, consider optimising performance with a DNS prefetch -->
<link rel="dns-prefetch" href="//embl.de" />
<!-- If you have custom icon, replace these as appropriate.
You can generate them at realfavicongenerator.net -->
<link rel="icon" type="image/x-icon" href="https://ebi.emblstatic.net/web_guidelines/EBI-Framework/v1.3/images/logos/EMBL-EBI/favicons/favicon.ico" />
<link rel="icon" type="image/png" href="https://ebi.emblstatic.net/web_guidelines/EBI-Framework/v1.3/images/logos/EMBL-EBI/favicons/favicon-32x32.png" />
<link rel="icon" type="image/png" sizes="192x192" href="https://ebi.emblstatic.net/web_guidelines/EBI-Framework/v1.3/images/logos/EMBL-EBI/favicons/android-chrome-192x192.png" /> <!-- Android (192px) -->
<link rel="apple-touch-icon-precomposed" sizes="114x114" href="https://ebi.emblstatic.net/web_guidelines/EBI-Framework/v1.3/images/logos/EMBL-EBI/favicons/apple-icon-114x114.png" /> <!-- For iPhone 4 Retina display (114px) -->
<link rel="apple-touch-icon-precomposed" sizes="72x72" href="https://ebi.emblstatic.net/web_guidelines/EBI-Framework/v1.3/images/logos/EMBL-EBI/favicons/apple-icon-72x72.png" /> <!-- For iPad (72px) -->
<link rel="apple-touch-icon-precomposed" sizes="144x144" href="https://ebi.emblstatic.net/web_guidelines/EBI-Framework/v1.3/images/logos/EMBL-EBI/favicons/apple-icon-144x144.png" /> <!-- For iPad retinat (144px) -->
<link rel="apple-touch-icon-precomposed" href="https://ebi.emblstatic.net/web_guidelines/EBI-Framework/v1.3/images/logos/EMBL-EBI/favicons/apple-icon-57x57.png" /> <!-- For iPhone (57px) -->
<link rel="mask-icon" href="https://ebi.emblstatic.net/web_guidelines/EBI-Framework/v1.3/images/logos/EMBL-EBI/favicons/safari-pinned-tab.svg" color="#ffffff" /> <!-- Safari icon for pinned tab -->
<meta name="msapplication-TileColor" content="#2b5797" /> <!-- MS Icons -->
<meta name="msapplication-TileImage" content="//ebi.emblstatic.net/web_guidelines/EBI-Framework/v1.3/images/logos/EMBL-EBI/favicons/mstile-144x144.png" />
<!-- CSS: implied media=all -->
<!-- CSS concatenated and minified via ant build script-->
<link rel="stylesheet" href="https://ebi.emblstatic.net/web_guidelines/EBI-Framework/v1.3/css/ebi-global.css" type="text/css" media="all" />
<link rel="stylesheet" href="https://dev.ebi.emblstatic.net/web_guidelines/EBI-Icon-fonts/v1.2/fonts.css" type="text/css" media="all" />
<!-- Use this CSS file for any custom styling -->
<!--
<link rel="stylesheet" href="css/custom.css" type="text/css" media="all" />
-->
<!-- If you have a custom header image or colour -->
<!--
<meta name="ebi:masthead-color" content="#000" />
<meta name="ebi:masthead-image" content="//www.ebi.ac.uk/web_guidelines/EBI-Framework/images/backgrounds/embl-ebi-background.jpg" />
-->
<!-- you can replace this with theme-[projectname].css. See http://www.ebi.ac.uk/web/style/colour for details of how to do this -->
<!-- also inform ES so we can host your colour palette file -->
<link rel="stylesheet" href="https://ebi.emblstatic.net/web_guidelines/EBI-Framework/v1.3/css/theme-embl-petrol.css" type="text/css" media="all" />
<link href="https://fonts.googleapis.com/css?family=Roboto:300,400,500" rel="stylesheet">
<!-- end CSS-->
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-34537522-7"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'UA-34537522-7');
</script>
</head>
<body class="level2"><!-- add any of your classes or IDs -->
<div id="skip-to">
<a href="#content">Skip to main content</a>
</div>
<style type="text/css">
.masthead.compact-for-data .masthead-inner {
padding-top: .5rem;
}
.masthead.compact-for-data .masthead-inner div#local-title {
margin-bottom: 0;
}
.masthead.compact-for-data .masthead-inner h1 {
font-size: 2.5rem;
margin-bottom: 0;
margin-top: -.5rem;
}
.masthead.compact-for-data .masthead-inner form {
margin-top: -1rem;
}
.masthead.compact-for-data .masthead-inner nav {
margin-top: .75rem;
clear: none;
}
</style>
<app-header></app-header> <!-- ** Application specific content ** -->
<div id="content">
<!-- Suggested layout containers -->
<section id="main-content-area" class="row expanded" role="main">
<app-root></app-root> <!-- ** Application specific content ** -->
</section>
<!-- Optional local footer (insert citation / project-specific copyright / etc here -->
<!--
<footer id="local-footer" class="local-footer" role="local-footer">
<div class="row">
<span class="reference">How to reference this page: ...</span>
</div>
</footer>
-->
<!-- End optional local footer -->
</div>
<!-- End suggested layout containers / #content -->
<app-footer></app-footer> <!-- ** Application specific content ** -->
<!-- JavaScript -->
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<script defer="defer" src="https://ebi.emblstatic.net/web_guidelines/EBI-Framework/v1.3/js/script.js"></script>
<script defer="defer" src="https://ebi.emblstatic.net/web_guidelines/EBI-Framework/v1.3/js/elixirBanner.js"></script>
<!-- The Foundation theme JavaScript -->
<script src="https://ebi.emblstatic.net/web_guidelines/EBI-Framework/v1.3/libraries/foundation-6/js/foundation.js"></script>
<script src="https://ebi.emblstatic.net/web_guidelines/EBI-Framework/v1.3/js/foundationExtendEBI.js"></script>
<script type="text/JavaScript">$(document).foundation();</script>
<script type="text/JavaScript">$(document).foundationExtendEBI();</script>
</body>
</html>
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment