-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merged in feature/SHIBUI-475 (pull request #68)
SHIBUI-475: Copy Provider Approved-by: Shibui Jenkins <shibui.jenkins@gmail.com> Approved-by: Ryan Mathis <rmathis@unicon.net>
- Loading branch information
Showing
41 changed files
with
1,282 additions
and
122 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,41 +1,78 @@ | ||
import { TestBed, async } from '@angular/core/testing'; | ||
import { Component, ViewChild } from '@angular/core'; | ||
import { TestBed, async, ComponentFixture } from '@angular/core/testing'; | ||
import { RouterTestingModule } from '@angular/router/testing'; | ||
import { StoreModule, Store, combineReducers } from '@ngrx/store'; | ||
import { AppComponent } from './app.component'; | ||
|
||
import { User } from './core/model/user'; | ||
import * as fromRoot from './core/reducer'; | ||
import * as fromVersion from './core/reducer/version.reducer'; | ||
import { NotificationModule } from './notification/notification.module'; | ||
import { NgbDropdownModule } from '@ng-bootstrap/ng-bootstrap'; | ||
|
||
@Component({ | ||
template: ` | ||
<app-root></app-root> | ||
` | ||
}) | ||
class TestHostComponent { | ||
@ViewChild(AppComponent) | ||
public componentUnderTest: AppComponent; | ||
} | ||
|
||
describe('AppComponent', () => { | ||
|
||
let fixture: ComponentFixture<TestHostComponent>; | ||
let instance: TestHostComponent; | ||
let app: AppComponent; | ||
let store: Store<fromRoot.State>; | ||
|
||
beforeEach(async(() => { | ||
TestBed.configureTestingModule({ | ||
imports: [ | ||
NgbDropdownModule.forRoot(), | ||
RouterTestingModule, | ||
StoreModule.forRoot({}), | ||
StoreModule.forRoot({ | ||
core: combineReducers(fromRoot.reducers) | ||
}), | ||
NotificationModule | ||
], | ||
declarations: [ | ||
AppComponent | ||
AppComponent, | ||
TestHostComponent | ||
], | ||
}).compileComponents(); | ||
|
||
store = TestBed.get(Store); | ||
spyOn(store, 'dispatch'); | ||
|
||
fixture = TestBed.createComponent(TestHostComponent); | ||
instance = fixture.componentInstance; | ||
app = instance.componentUnderTest; | ||
fixture.detectChanges(); | ||
})); | ||
|
||
it('should create the app', async(() => { | ||
const fixture = TestBed.createComponent(AppComponent); | ||
const app = fixture.debugElement.componentInstance; | ||
expect(app).toBeTruthy(); | ||
expect(store.dispatch).toHaveBeenCalledTimes(4); | ||
})); | ||
|
||
it(`should have as title 'Shib-UI'`, async(() => { | ||
const fixture = TestBed.createComponent(AppComponent); | ||
const app = fixture.debugElement.componentInstance; | ||
expect(app.title).toEqual('Shib UI'); | ||
})); | ||
|
||
describe('version format', () => { | ||
it('should return a formatted string', () => { | ||
expect(app.formatter({ | ||
build: { | ||
version: 'foo' | ||
}, | ||
git: { | ||
commit: { | ||
id: 'bar' | ||
} | ||
} | ||
})).toEqual('foo-bar'); | ||
}); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,4 +6,4 @@ export interface MDUI { | |
logoHeight?: number; | ||
logoWidth?: number; | ||
description?: string; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
import { Action } from '@ngrx/store'; | ||
import { MetadataProvider } from '../../domain/model/metadata-provider'; | ||
|
||
export enum CopySourceActionTypes { | ||
CREATE_PROVIDER_COPY_REQUEST = '[Copy Provider] Create Provider Copy Request', | ||
CREATE_PROVIDER_COPY_SUCCESS = '[Copy Provider] Create Provider Copy Success', | ||
CREATE_PROVIDER_COPY_ERROR = '[Copy Provider] Create Provider Copy Error', | ||
|
||
UPDATE_PROVIDER_COPY = '[Copy Provider] Update Provider Copy Request', | ||
|
||
SAVE_PROVIDER_COPY_REQUEST = '[Copy Provider] Save Provider Copy Request', | ||
SAVE_PROVIDER_COPY_SUCCESS = '[Copy Provider] Save Provider Copy Request', | ||
SAVE_PROVIDER_COPY_ERROR = '[Copy Provider] Save Provider Copy Request', | ||
} | ||
|
||
export class CreateProviderCopyRequest implements Action { | ||
readonly type = CopySourceActionTypes.CREATE_PROVIDER_COPY_REQUEST; | ||
|
||
constructor(public payload: { entityId: string, serviceProviderName: string, target: string }) { } | ||
} | ||
|
||
export class CreateProviderCopySuccess implements Action { | ||
readonly type = CopySourceActionTypes.CREATE_PROVIDER_COPY_SUCCESS; | ||
|
||
constructor(public payload: MetadataProvider) { } | ||
} | ||
|
||
export class CreateProviderCopyError implements Action { | ||
readonly type = CopySourceActionTypes.CREATE_PROVIDER_COPY_ERROR; | ||
|
||
constructor(public payload: Error) { } | ||
} | ||
|
||
export class UpdateProviderCopy implements Action { | ||
readonly type = CopySourceActionTypes.UPDATE_PROVIDER_COPY; | ||
|
||
constructor(public payload: Partial<MetadataProvider>) { } | ||
} | ||
|
||
export type CopySourceActionUnion = | ||
| CreateProviderCopyRequest | ||
| CreateProviderCopySuccess | ||
| CreateProviderCopyError | ||
| UpdateProviderCopy; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import { Action } from '@ngrx/store'; | ||
import { MetadataProvider } from '../../domain/model/metadata-provider'; | ||
|
||
export enum SearchActionTypes { | ||
SEARCH_IDS = '[Search Provider Ids] Request', | ||
SEARCH_IDS_SUCCESS = '[Search Provider Ids] Success', | ||
SEARCH_IDS_ERROR = '[Search Provider Ids] Error' | ||
} | ||
|
||
export class SearchIds implements Action { | ||
readonly type = SearchActionTypes.SEARCH_IDS; | ||
|
||
constructor(public payload: string) { } | ||
} | ||
export class SearchIdsSuccess implements Action { | ||
readonly type = SearchActionTypes.SEARCH_IDS_SUCCESS; | ||
|
||
constructor(public payload: string[]) { } | ||
} | ||
export class SearchIdsError implements Action { | ||
readonly type = SearchActionTypes.SEARCH_IDS_ERROR; | ||
|
||
constructor(public payload: any) { } | ||
} | ||
|
||
export type SearchActionUnion = | ||
| SearchIds | ||
| SearchIdsSuccess | ||
| SearchIdsError; |
Oops, something went wrong.