chore(textarea): fix typos in tests
This commit is contained in:
parent
edd3440a39
commit
80b816e3d1
1 changed files with 9 additions and 8 deletions
|
|
@ -11,7 +11,7 @@ describe('<lion-textarea>', () => {
|
||||||
expect(el.querySelector('textarea').nodeName).to.equal('TEXTAREA');
|
expect(el.querySelector('textarea').nodeName).to.equal('TEXTAREA');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('has a default minRows of 2 and maxRows of 10', async () => {
|
it('has default minRows and maxRows', async () => {
|
||||||
const el = await fixture(`<lion-textarea></lion-textarea>`);
|
const el = await fixture(`<lion-textarea></lion-textarea>`);
|
||||||
expect(el.rows).to.equal(2);
|
expect(el.rows).to.equal(2);
|
||||||
expect(el.maxRows).to.equal(6);
|
expect(el.maxRows).to.equal(6);
|
||||||
|
|
@ -31,13 +31,13 @@ describe('<lion-textarea>', () => {
|
||||||
const initialHeight = el.offsetHeight;
|
const initialHeight = el.offsetHeight;
|
||||||
el.modelValue = 'batman\nand\nrobin\nand\ncatwoman';
|
el.modelValue = 'batman\nand\nrobin\nand\ncatwoman';
|
||||||
await el.updateComplete;
|
await el.updateComplete;
|
||||||
const hightWith4TextLines = el.offsetHeight;
|
const hightWith5TextLines = el.offsetHeight;
|
||||||
expect(hightWith4TextLines > initialHeight).to.equal(true);
|
expect(hightWith5TextLines > initialHeight).to.equal(true);
|
||||||
|
|
||||||
el.modelValue = 'batman';
|
el.modelValue = 'batman';
|
||||||
await el.updateComplete;
|
await el.updateComplete;
|
||||||
const hightWith1Line = el.offsetHeight;
|
const hightWith1Line = el.offsetHeight;
|
||||||
expect(hightWith1Line < hightWith4TextLines).to.equal(true);
|
expect(hightWith1Line < hightWith5TextLines).to.equal(true);
|
||||||
});
|
});
|
||||||
|
|
||||||
it(`starts growing when content is bigger than "rows"
|
it(`starts growing when content is bigger than "rows"
|
||||||
|
|
@ -62,10 +62,11 @@ describe('<lion-textarea>', () => {
|
||||||
});
|
});
|
||||||
|
|
||||||
it('stops shrinking after property "rows" is reached', async () => {
|
it('stops shrinking after property "rows" is reached', async () => {
|
||||||
const el = await fixture(`<lion-textarea></lion-textarea>`);
|
const el = await fixture(
|
||||||
el.rows = 1;
|
html`
|
||||||
el.maxRows = 3;
|
<lion-textarea rows="1" max-rows="3"></lion-textarea>
|
||||||
await el.updateComplete;
|
`,
|
||||||
|
);
|
||||||
|
|
||||||
expect(el.scrollHeight).to.be.equal(el.clientHeight);
|
expect(el.scrollHeight).to.be.equal(el.clientHeight);
|
||||||
const oneRowHeight = el.clientHeight;
|
const oneRowHeight = el.clientHeight;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue