Skip to content

Commit

Permalink
test: fix input tests
Browse files Browse the repository at this point in the history
  • Loading branch information
phoebus-84 committed Feb 29, 2024
1 parent 1a63b95 commit 11bfbfa
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/components/input/d-input.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export class DInput {
class={{
'input': true,
'ion-invalid': Boolean(this.errorText),
'ion-touched': this.value.length > 0,
'ion-touched': this.value && this.value.length > 0,
}}
type={this.type}
name={this.name}
Expand Down
4 changes: 3 additions & 1 deletion src/components/input/test/d-input.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,10 @@ describe('d-input', () => {
html: `<d-input></d-input>`,
});
expect(page.root).toEqualHtml(`
<d-input>
<d-input type="text">
<mock:shadow-root>
<d-text class="label" size="m"></d-text>
<ion-input class="input" fill="outline" type="text"></ion-input>
<slot></slot>
</mock:shadow-root>
</d-input>
Expand Down

0 comments on commit 11bfbfa

Please sign in to comment.