-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(select): prevent empty select height collapsing (#1643)
- Loading branch information
Showing
8 changed files
with
84 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import { browser, by, element, ElementArrayFinder } from 'protractor'; | ||
|
||
describe('nb-select', () => { | ||
|
||
beforeEach((done) => { | ||
browser.get('#/select/select-test.component').then(done); | ||
}); | ||
|
||
it('should not shrink when has no placeholder and text', (done) => { | ||
const checks: Promise<void>[] = []; | ||
const selectHeights = [ 24, 32, 40, 48, 56 ]; | ||
const selectElements: ElementArrayFinder = element.all(by.tagName('nb-select')); | ||
|
||
for (let i = 0; i < selectElements.length; i++) { | ||
const check = Promise.all([selectElements[i].getText(), selectElements[i].getSize()]) | ||
.then(([text, { height }]) => { | ||
expect(text).toEqual(''); | ||
expect(height).toEqual(selectHeights[i]); | ||
}); | ||
|
||
checks.push(check); | ||
} | ||
|
||
Promise.all(checks).then(done); | ||
}); | ||
}); |
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
17 changes: 17 additions & 0 deletions
17
src/playground/with-layout/select/select-test.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,17 @@ | ||
import { Component } from '@angular/core'; | ||
import { NbComponentSize } from '@nebular/theme'; | ||
|
||
@Component({ | ||
template: ` | ||
<h1>Empty select height test</h1> | ||
<nb-select *ngFor="let size of sizes" [size]="size"></nb-select> | ||
`, | ||
styles: [` | ||
nb-select { | ||
display: block; | ||
} | ||
`], | ||
}) | ||
export class SelectTestComponent { | ||
sizes: NbComponentSize[] = [ 'tiny', 'small', 'medium', 'large', 'giant' ]; | ||
} |
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