Skip to content

Commit

Permalink
internal(text-control): add missing prefix/suffix to summary item layout
Browse files Browse the repository at this point in the history
  • Loading branch information
pheekus committed Sep 3, 2024
1 parent 4299789 commit 337a941
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -349,4 +349,22 @@ describe('InternalTextControl', () => {

submitMethod.restore();
});

it('renders prefix text in summary item layout', async () => {
const control = await fixture<TestControl>(html`
<test-internal-text-control layout="summary-item" prefix="Test Prefix">
</test-internal-text-control>
`);

expect(control.renderRoot).to.include.text('Test Prefix');
});

it('renders suffix text in summary item layout', async () => {
const control = await fixture<TestControl>(html`
<test-internal-text-control layout="summary-item" suffix="Test Suffix">
</test-internal-text-control>
`);

expect(control.renderRoot).to.include.text('Test Suffix');
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,8 @@ export class InternalTextControl extends InternalEditableControl {
</div>
<div class="flex-1 flex items-center gap-xs" style="min-width: 30%">
${this.prefix ? html`<div>${this.prefix}</div>` : ''}
<input
placeholder=${this.placeholder}
class=${classMap({
Expand All @@ -124,6 +126,8 @@ export class InternalTextControl extends InternalEditableControl {
}}
/>
${this.suffix ? html`<div class="font-medium text-secondary">${this.suffix}</div>` : ''}
<button
aria-label=${this.t('clear')}
class=${classMap({
Expand Down

0 comments on commit 337a941

Please sign in to comment.