Skip to content

Commit

Permalink
Test Updates (hyperledger-archives#2889)
Browse files Browse the repository at this point in the history
Deleted About Component
Updated Tests In All Basic-Modals
Updated Tests In Common Components
Updated AddFileComponent
Updated FooterComponent

contributes to hyperledger/composer#2887

Signed-off-by: Caroline Church <[email protected]>
  • Loading branch information
cazfletch authored Nov 29, 2017
1 parent 5075b91 commit b3b1bc9
Show file tree
Hide file tree
Showing 28 changed files with 1,601 additions and 1,270 deletions.

This file was deleted.

10 changes: 0 additions & 10 deletions packages/composer-playground/src/app/about/about.component.scss

This file was deleted.

57 changes: 0 additions & 57 deletions packages/composer-playground/src/app/about/about.component.spec.ts

This file was deleted.

23 changes: 0 additions & 23 deletions packages/composer-playground/src/app/about/about.component.ts

This file was deleted.

1 change: 0 additions & 1 deletion packages/composer-playground/src/app/about/index.ts

This file was deleted.

2 changes: 0 additions & 2 deletions packages/composer-playground/src/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ import { AppRoutingModule } from './app-routing.module';
import { AppComponent } from './app.component';
import { APP_RESOLVER_PROVIDERS } from './app.resolver';
import { AppState, InternalStateType } from './app.service';
import { AboutComponent } from './about';
import { BasicModalsModule } from './basic-modals/basic-modals.module';
import { WelcomeComponent } from './welcome';
import { NoContentComponent } from './no-content';
Expand Down Expand Up @@ -58,7 +57,6 @@ type StoreType = {
WelcomeComponent
],
declarations: [
AboutComponent,
AppComponent,
NoContentComponent,
VersionCheckComponent,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { ErrorComponent } from './error/error.component';
import { ReplaceComponent } from './replace-confirm/replace-confirm.component';
import { SuccessComponent } from './success/success.component';
import { AlertService } from './alert.service';
import { TestModule } from './../test/test.module';
import { TestModule } from '../test/test.module';

@NgModule({
imports: [CommonModule, NgbModule, TestModule],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,33 +2,68 @@
/* tslint:disable:no-unused-expression */
/* tslint:disable:no-var-requires */
/* tslint:disable:max-classes-per-file */
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { ComponentFixture, TestBed, async } from '@angular/core/testing';
import { Component, DebugElement } from '@angular/core';
import { By } from '@angular/platform-browser';

import * as sinon from 'sinon';
import * as chai from 'chai';

let should = chai.should();

import { BusyComponent } from './busy.component';
import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap';

@Component({
template: `
<busy [busy]="busy"></busy>`
})
class TestHostComponent {
busy = {
title: 'myTitle',
text: 'myText'
};
}

describe('BusyComponent', () => {
let component: BusyComponent;
let fixture: ComponentFixture<BusyComponent>;
let component: TestHostComponent;
let fixture: ComponentFixture<TestHostComponent>;

let mockActiveModal = sinon.createStubInstance(NgbActiveModal);

let busyElement: DebugElement;

beforeEach(() => {
TestBed.configureTestingModule({
declarations: [BusyComponent],
declarations: [BusyComponent, TestHostComponent],
providers: [{provide: NgbActiveModal, useValue: mockActiveModal}]
});

fixture = TestBed.createComponent(BusyComponent);
fixture = TestBed.createComponent(TestHostComponent);
component = fixture.componentInstance;

busyElement = fixture.debugElement.query(By.css('busy'));
});

it('should create', () => {
component.should.be.ok;
});

it('should display the error', () => {
fixture.detectChanges();
let titleElement = busyElement.queryAll(By.css('span'));
titleElement[1].nativeElement.innerHTML.should.equal('myTitle');

let textElement = busyElement.queryAll(By.css('.busy-text'));
textElement[0].nativeElement.innerHTML.should.equal('myText');

component['busy'] = {
title: 'differentTitle',
text: 'differentText'
};

fixture.detectChanges();
// titleElement = busyElement.queryAll(By.css('span'));
titleElement[1].nativeElement.innerHTML.should.equal('differentTitle');

// textElement = busyElement.queryAll(By.css('.busy-text'));
textElement[0].nativeElement.innerHTML.should.equal('differentText');
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<use xlink:href="#icon-warn_32"></use>
</svg>
<h1>{{headerMessage}}</h1>
<button class="icon modal-exit" (click)="activeModal.close(false)">
<button class="icon modal-exit" (click)="activeModal.dismiss()">
<svg class="ibm-icon" aria-hidden="true">
<use xlink:href="#icon-close_new"></use>
</svg>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,24 @@
@import '../../../assets/styles/base/_variables.scss';

.delete {


.modal-header {
svg {
fill: $error-colour-1
.modal-header {
svg {
fill: $error-colour-1
}
}
}

.information {
display: flex;
flex-direction: column;
align-content: flex-start;
margin-left: $space-large;
}

.items {
border-left: solid $first-highlight;
.information {
display: flex;
flex-direction: column;
align-content: flex-start;
margin-left: $space-large;
}

.item{
margin-left: $space-medium;
}
}
.items {
border-left: solid $first-highlight;

.item {
margin-left: $space-medium;
}
}
}
Loading

0 comments on commit b3b1bc9

Please sign in to comment.