Skip to content
This repository has been archived by the owner on Dec 8, 2022. It is now read-only.

Commit

Permalink
New visual tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Blackbaud-TrevorBurch committed Nov 28, 2018
1 parent 7f8649e commit f2b294a
Show file tree
Hide file tree
Showing 6 changed files with 76 additions and 0 deletions.
40 changes: 40 additions & 0 deletions e2e/validation.e2e-spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
import {
by,
element
} from 'protractor';

import {
expect,
SkyHostBrowser
} from '@skyux-sdk/e2e';

describe('Validation', () => {

beforeEach(() => {
SkyHostBrowser.get('visual/validation');
SkyHostBrowser.setWindowBreakpoint('lg');
});

it('should match the text input required screenshot', (done) => {
// Click on input
element(by.css('#text-input input')).click();
// Click off input
element(by.css('#select-input select')).click();
expect('#text-input')
.toMatchBaselineScreenshot(done, {
screenshotName: 'standard-input-validation'
});
});

it('should match the select input required screenshot', (done) => {
// Click on select
element(by.css('#select-input select')).click();
// Click off select
element(by.css('#text-input input')).click();
expect('#select-input')
.toMatchBaselineScreenshot(done, {
screenshotName: 'select-validation'
});
});

});
3 changes: 3 additions & 0 deletions src/app/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,7 @@
<li>
<a href="#" skyAppLink="/visual/inputs">Native form controls</a>
</li>
<li>
<a href="#" skyAppLink="/visual/validation">Validation</a>
</li>
</ul>
1 change: 1 addition & 0 deletions src/app/visual/validation/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<sky-validation-demo></sky-validation-demo>
12 changes: 12 additions & 0 deletions src/app/visual/validation/validation-demo.component.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<div id="text-input">
<label for="textInput" class="sky-control-label sky-control-label-required">
Text Input
</label>
<input type="text" name="textInput" [(ngModel)]="textInput" class="sky-form-control" required>
</div>
<div id="select-input">
<select [(ngModel)]="selectInput" class="sky-form-control" required>
<option value="1">Option 1</option>
<option value="2">Option 2</option>
</select>
</div>
5 changes: 5 additions & 0 deletions src/app/visual/validation/validation-demo.component.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#text-input, #select-input {
width: 95%;
margin: 10px;
padding: 10px;
}
15 changes: 15 additions & 0 deletions src/app/visual/validation/validation-demo.component.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import {
Component
} from '@angular/core';

@Component({
selector: 'sky-validation-demo',
templateUrl: './validation-demo.component.html',
styleUrls: ['./validation-demo.component.scss']
})
export class SkyValidationDemoComponent {

public textInput: string;
public selectInput: string;

}

0 comments on commit f2b294a

Please sign in to comment.