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.
Contrib > Lookup Component (Part 2) > Autocomplete component (#1438)
- Loading branch information
1 parent
2def0f3
commit f1650dc
Showing
43 changed files
with
1,998 additions
and
100 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
10 changes: 10 additions & 0 deletions
10
skyux-spa-visual-tests/src/app/autocomplete/autocomplete-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,10 @@ | ||
<div id="screenshot-autocomplete"> | ||
<label for="favorite-color">Favorite color</label> | ||
<sky-autocomplete | ||
[data]="data"> | ||
<input | ||
id="favorite-color" | ||
skyAutocomplete | ||
type="text"> | ||
</sky-autocomplete> | ||
</div> |
23 changes: 23 additions & 0 deletions
23
skyux-spa-visual-tests/src/app/autocomplete/autocomplete-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,23 @@ | ||
import { | ||
Component | ||
} from '@angular/core'; | ||
|
||
@Component({ | ||
selector: 'autocomplete-visual', | ||
templateUrl: './autocomplete-visual.component.html' | ||
}) | ||
export class AutocompleteVisualComponent { | ||
public data: any[] = [ | ||
{ name: 'Red' }, | ||
{ name: 'Blue' }, | ||
{ name: 'Green' }, | ||
{ name: 'Orange' }, | ||
{ name: 'Pink' }, | ||
{ name: 'Purple' }, | ||
{ name: 'Yellow' }, | ||
{ name: 'Brown' }, | ||
{ name: 'Turquoise' }, | ||
{ name: 'White' }, | ||
{ name: 'Black' } | ||
]; | ||
} |
54 changes: 54 additions & 0 deletions
54
skyux-spa-visual-tests/src/app/autocomplete/autocomplete.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,54 @@ | ||
import { | ||
browser, | ||
by, | ||
element | ||
} from 'protractor'; | ||
|
||
import { SkyVisualTest } from '../../../config/utils/visual-test-commands'; | ||
|
||
describe('Autocomplete', () => { | ||
it('should match previous alert screenshot', () => { | ||
return SkyVisualTest | ||
.setupTest('autocomplete') | ||
.then(() => { | ||
const input = element(by.css('input')); | ||
input.value = 'r'; | ||
input.click(); | ||
browser.actions().sendKeys('r').perform(); | ||
|
||
browser.wait(() => { | ||
return browser.isElementPresent( | ||
element(by.css('.sky-dropdown-item')) | ||
); | ||
}); | ||
|
||
return SkyVisualTest.compareScreenshot({ | ||
screenshotName: 'autocomplete', | ||
selector: '#screenshot-autocomplete' | ||
}); | ||
}); | ||
}); | ||
|
||
it('should match previous alert screenshot on small screens', () => { | ||
return SkyVisualTest | ||
.setupTest('autocomplete', 480) | ||
.then(() => { | ||
|
||
const input = element(by.css('input')); | ||
input.value = 'r'; | ||
input.click(); | ||
browser.actions().sendKeys('r').perform(); | ||
|
||
browser.wait(() => { | ||
return browser.isElementPresent( | ||
element(by.css('.sky-dropdown-item')) | ||
); | ||
}); | ||
|
||
return SkyVisualTest.compareScreenshot({ | ||
screenshotName: 'autocomplete', | ||
selector: '#screenshot-autocomplete' | ||
}); | ||
}); | ||
}); | ||
}); |
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 @@ | ||
<autocomplete-visual></autocomplete-visual> |
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
Oops, something went wrong.