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 1
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
7f8649e
commit f2b294a
Showing
6 changed files
with
76 additions
and
0 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
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' | ||
}); | ||
}); | ||
|
||
}); |
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 @@ | ||
<sky-validation-demo></sky-validation-demo> |
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,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> |
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,5 @@ | ||
#text-input, #select-input { | ||
width: 95%; | ||
margin: 10px; | ||
padding: 10px; | ||
} |
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,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; | ||
|
||
} |