This repository has been archived by the owner on Dec 8, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 65
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
602e883
commit 9986ae9
Showing
81 changed files
with
3,504 additions
and
2 deletions.
There are no files selected for viewing
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 @@ | ||
<link-records-visual></link-records-visual> |
195 changes: 195 additions & 0 deletions
195
skyux-spa-visual-tests/src/app/link-records/link-records-visual.component.html
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,195 @@ | ||
<div id="screenshot-link-records-match"> | ||
<sky-link-records [items]="items" [matches]="matches" [showNewFieldValues]="false"> | ||
<sky-link-records-item-title> | ||
<ng-template let-item="item">Applicant</ng-template> | ||
</sky-link-records-item-title> | ||
<sky-link-records-item-content> | ||
<ng-template let-item="item" > | ||
<div>Original Item</div> | ||
<div>{{ item?.id }}</div> | ||
<div>{{ item?.name }}</div> | ||
<div>{{ item?.description }}</div> | ||
</ng-template> | ||
</sky-link-records-item-content> | ||
<sky-link-records-match-content> | ||
<ng-template let-match="match"> | ||
<div>Match Item</div> | ||
<div>{{ match?.item?.id }}</div> | ||
<div>{{ match?.item?.name }}</div> | ||
<div>{{ match?.item?.description }}</div> | ||
</ng-template> | ||
</sky-link-records-match-content> | ||
<sky-link-records-nomatch-content> | ||
<ng-template let-item="item" let-match="match" let-api="api"> | ||
<div *ngIf="match?.item"> | ||
<div>Match Item</div> | ||
<div>{{ match?.item?.id }}</div> | ||
<div>{{ match?.item?.name }}</div> | ||
<div>{{ match?.item?.description }}</div> | ||
</div> | ||
<div *ngIf="!match?.item"> | ||
<div>Match Search</div> | ||
<button class="sky-btn sky-btn-default" (click)="api.addSelectedItem(item?.id, newItem)"> | ||
Test Select | ||
</button> | ||
</div> | ||
</ng-template> | ||
</sky-link-records-nomatch-content> | ||
</sky-link-records> | ||
</div> | ||
|
||
<div id="screenshot-link-records-no-match"> | ||
<sky-link-records [items]="items" [matches]="matches2" [showNewFieldValues]="false"> | ||
<sky-link-records-item-title> | ||
<ng-template let-item="item">Applicant</ng-template> | ||
</sky-link-records-item-title> | ||
<sky-link-records-item-content> | ||
<ng-template let-item="item" > | ||
<div>Original Item</div> | ||
<div>{{ item?.id }}</div> | ||
<div>{{ item?.name }}</div> | ||
<div>{{ item?.description }}</div> | ||
</ng-template> | ||
</sky-link-records-item-content> | ||
<sky-link-records-match-content> | ||
<ng-template let-match="match"> | ||
<div>Match Item</div> | ||
<div>{{ match?.item?.id }}</div> | ||
<div>{{ match?.item?.name }}</div> | ||
<div>{{ match?.item?.description }}</div> | ||
</ng-template> | ||
</sky-link-records-match-content> | ||
<sky-link-records-nomatch-content> | ||
<ng-template let-item="item" let-match="match" let-api="api"> | ||
<div *ngIf="match?.item"> | ||
<div>Match Item</div> | ||
<div>{{ match?.item?.id }}</div> | ||
<div>{{ match?.item?.name }}</div> | ||
<div>{{ match?.item?.description }}</div> | ||
</div> | ||
<div *ngIf="!match?.item"> | ||
</div> | ||
</ng-template> | ||
</sky-link-records-nomatch-content> | ||
</sky-link-records> | ||
</div> | ||
|
||
<div id="screenshot-link-records-linked-match"> | ||
<sky-link-records [items]="items" [matches]="matches" [showNewFieldValues]="false" id="linked-match-records" > | ||
<sky-link-records-item-title> | ||
<ng-template let-item="item">Applicant</ng-template> | ||
</sky-link-records-item-title> | ||
<sky-link-records-item-content> | ||
<ng-template let-item="item" > | ||
<div>Original Item</div> | ||
<div>{{ item?.id }}</div> | ||
<div>{{ item?.name }}</div> | ||
<div>{{ item?.description }}</div> | ||
</ng-template> | ||
</sky-link-records-item-content> | ||
<sky-link-records-match-content> | ||
<ng-template let-match="match"> | ||
<div>Match Item</div> | ||
<div>{{ match?.item?.id }}</div> | ||
<div>{{ match?.item?.name }}</div> | ||
<div>{{ match?.item?.description }}</div> | ||
</ng-template> | ||
</sky-link-records-match-content> | ||
<sky-link-records-nomatch-content> | ||
<ng-template let-item="item" let-match="match" let-api="api"> | ||
<div *ngIf="match?.item"> | ||
<div>Match Item</div> | ||
<div>{{ match?.item?.id }}</div> | ||
<div>{{ match?.item?.name }}</div> | ||
<div>{{ match?.item?.description }}</div> | ||
</div> | ||
<div *ngIf="!match?.item"> | ||
<div>Match Search</div> | ||
<button class="sky-btn sky-btn-default" (click)="api.addSelectedItem(item?.id, newItem)"> | ||
Test Select | ||
</button> | ||
</div> | ||
</ng-template> | ||
</sky-link-records-nomatch-content> | ||
</sky-link-records> | ||
</div> | ||
|
||
<div id="screenshot-link-records-created-match"> | ||
<sky-link-records [items]="items" [matches]="matches2" [showNewFieldValues]="false" id="create-link-records" > | ||
<sky-link-records-item-title> | ||
<ng-template let-item="item">Applicant</ng-template> | ||
</sky-link-records-item-title> | ||
<sky-link-records-item-content> | ||
<ng-template let-item="item" > | ||
<div>Original Item</div> | ||
<div>{{ item?.id }}</div> | ||
<div>{{ item?.name }}</div> | ||
<div>{{ item?.description }}</div> | ||
</ng-template> | ||
</sky-link-records-item-content> | ||
<sky-link-records-match-content> | ||
<ng-template let-match="match"> | ||
<div>Match Item</div> | ||
<div>{{ match?.item?.id }}</div> | ||
<div>{{ match?.item?.name }}</div> | ||
<div>{{ match?.item?.description }}</div> | ||
</ng-template> | ||
</sky-link-records-match-content> | ||
<sky-link-records-nomatch-content> | ||
<ng-template let-item="item" let-match="match" let-api="api"> | ||
<div *ngIf="match?.item"> | ||
<div>Match Item</div> | ||
<div>{{ match?.item?.id }}</div> | ||
<div>{{ match?.item?.name }}</div> | ||
<div>{{ match?.item?.description }}</div> | ||
</div> | ||
<div *ngIf="!match?.item"> | ||
<div>Match Search</div> | ||
<button class="sky-btn sky-btn-default" (click)="api.addSelectedItem(item?.id, newItem)"> | ||
Test Select | ||
</button> | ||
</div> | ||
</ng-template> | ||
</sky-link-records-nomatch-content> | ||
</sky-link-records> | ||
</div> | ||
|
||
<div id="screenshot-link-records-fields-update"> | ||
<sky-link-records [items]="items" [matches]="matches" [matchFields]="matchFields" [showNewFieldValues]="false" id="field-update-records"> | ||
<sky-link-records-item-title> | ||
<ng-template let-item="item">Applicant</ng-template> | ||
</sky-link-records-item-title> | ||
<sky-link-records-item-content> | ||
<ng-template let-item="item" > | ||
<div>Original Item</div> | ||
<div>{{ item?.id }}</div> | ||
<div>{{ item?.name }}</div> | ||
<div>{{ item?.description }}</div> | ||
</ng-template> | ||
</sky-link-records-item-content> | ||
<sky-link-records-match-content> | ||
<ng-template let-match="match"> | ||
<div>Match Item</div> | ||
<div>{{ match?.item?.id }}</div> | ||
<div>{{ match?.item?.name }}</div> | ||
<div>{{ match?.item?.description }}</div> | ||
</ng-template> | ||
</sky-link-records-match-content> | ||
<sky-link-records-nomatch-content> | ||
<ng-template let-item="item" let-match="match" let-api="api"> | ||
<div *ngIf="match?.item"> | ||
<div>Match Item</div> | ||
<div>{{ match?.item?.id }}</div> | ||
<div>{{ match?.item?.name }}</div> | ||
<div>{{ match?.item?.description }}</div> | ||
</div> | ||
<div *ngIf="!match?.item"> | ||
<div>Match Search</div> | ||
<button class="sky-btn sky-btn-default" (click)="api.addSelectedItem(item?.id, newItem)"> | ||
Test Select | ||
</button> | ||
</div> | ||
</ng-template> | ||
</sky-link-records-nomatch-content> | ||
</sky-link-records> | ||
</div> |
33 changes: 33 additions & 0 deletions
33
skyux-spa-visual-tests/src/app/link-records/link-records-visual.component.ts
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,33 @@ | ||
import { Component } from '@angular/core'; | ||
import { Observable } from 'rxjs/Observable'; | ||
import 'rxjs/add/observable/of'; | ||
|
||
@Component({ | ||
selector: 'link-records-visual', | ||
templateUrl: './link-records-visual.component.html' | ||
}) | ||
export class LinkRecordsVisualComponent { | ||
public matchFields: Array<any> = [{key: 'description'}, {key: 'name'}]; | ||
|
||
public newItem: any = { id: '99', address: 999, name: 'Lime', description: 'Laura eats limes.' }; | ||
|
||
public items: Observable<any> = Observable.of([ | ||
{ id: '1', address: 101, name: 'Apple', description: 'Anne eats apples' } | ||
]); | ||
|
||
public matches: Observable<Array<any>> = Observable.of([ | ||
{ | ||
key: '1', | ||
status: 'suggested', | ||
item: { id: '11', address: 111, name: 'Big Apple', description: 'George and his apples' } | ||
} | ||
]); | ||
|
||
public matches2: Observable<Array<any>> = Observable.of([ | ||
{ | ||
key: '1', | ||
status: 'no_match', | ||
item: undefined | ||
} | ||
]); | ||
} |
62 changes: 62 additions & 0 deletions
62
skyux-spa-visual-tests/src/app/link-records/link-records.visual-spec.ts
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,62 @@ | ||
import { SkyVisualTest } from '../../../config/utils/visual-test-commands'; | ||
import { element, by } from 'protractor'; | ||
|
||
describe('link-records component', () => { | ||
|
||
it('should display suggested match', () => { | ||
return SkyVisualTest.setupTest('link-records') | ||
.then(() => { | ||
return SkyVisualTest.compareScreenshot({ | ||
screenshotName: 'link_records_match', | ||
selector: '#screenshot-link-records-match', | ||
checkAccessibility: true | ||
}); | ||
}); | ||
}); | ||
|
||
it('should display no match', () => { | ||
return SkyVisualTest.setupTest('link-records') | ||
.then(() => { | ||
return SkyVisualTest.compareScreenshot({ | ||
screenshotName: 'link_records_no_match', | ||
selector: '#screenshot-link-records-no-match', | ||
checkAccessibility: true | ||
}); | ||
}); | ||
}); | ||
|
||
it('should display linked match', () => { | ||
return SkyVisualTest.setupTest('link-records') | ||
.then(() => { | ||
element(by.css('#linked-match-records .link-records-item-footer .sky-btn-primary')).click(); | ||
return SkyVisualTest.compareScreenshot({ | ||
screenshotName: 'link_records_linked_match', | ||
selector: '#screenshot-link-records-linked-match', | ||
checkAccessibility: true | ||
}); | ||
}); | ||
}); | ||
|
||
it('should display created match', () => { | ||
return SkyVisualTest.setupTest('link-records') | ||
.then(() => { | ||
element(by.css('#create-link-records .link-records-item-footer .sky-btn-link')).click(); | ||
return SkyVisualTest.compareScreenshot({ | ||
screenshotName: 'link_records_created_match', | ||
selector: '#screenshot-link-records-created-match', | ||
checkAccessibility: true | ||
}); | ||
}); | ||
}); | ||
|
||
it('should display fields to update on a match', () => { | ||
return SkyVisualTest.setupTest('link-records') | ||
.then(() => { | ||
element(by.css('#field-update-records .link-records-item-footer .sky-btn-primary')).click(); | ||
return SkyVisualTest.compareScreenshot({ | ||
screenshotName: 'link_records_fields_update', | ||
selector: '#screenshot-link-records-fields-update' | ||
}); | ||
}); | ||
}); | ||
}); |
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
Oops, something went wrong.