Skip to content

Commit

Permalink
added test
Browse files Browse the repository at this point in the history
  • Loading branch information
corinaper committed Nov 6, 2024
1 parent ca05bdf commit 3f3e0f1
Show file tree
Hide file tree
Showing 2 changed files with 82 additions and 0 deletions.
77 changes: 77 additions & 0 deletions src/components/ec-dropdown/__snapshots__/ec-dropdown.spec.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -475,6 +475,83 @@ exports[`EcDropdown > :props > should render given popover style when it is a fu
</ul>
</div>
</ec-stub>
</div>
`;

exports[`EcDropdown > :props > should render properly when the bottomNote prop is set 1`] = `
<div
class="ec-dropdown ec-dropdown-search"
data-test="ec-dropdown ec-dropdown-search"
is-in-light-mode="false"
>
<ec-stub
autosize="true"
class="ec-dropdown-search__trigger"
data-test="ec-popover-dropdown-search ec-stub ec-popover-stub"
disabled="false"
distance="8"
placement="bottom-start"
popperclass="ec-dropdown-search__popover"
shift="false"
shown="false"
>
<div
class="ec-input-field"
data-test="ec-input-field"
>
<!--v-if-->
<input
class="ec-input-field__input ec-input-field__input--bg-gray-8 ec-input-field__input--has-icon ec-input-field__input--cursor-pointer"
data-test="ec-dropdown__input ec-input-field__input ec-mock ec-tooltip-mock"
id="ec-input-field-1"
placeholder=""
readonly=""
type="text"
/>
<!--v-if-->
<div
class="ec-input-field__icon-wrapper ec-input-field__icon-wrapper--right"
data-test="ec-input-field__icon-wrapper"
>
<!--v-if-->
<svg
class="ec-icon ec-input-field__icon"
data-test="ec-input-field__icon"
height="24"
width="24"
>
<use
xlink:href="#ec-simple-chevron-down"
/>
</svg>
</div>
<div
class="ec-input-field__bottom-note"
data-test="ec-input-field__bottom-note"
>
Testing the bottomNote prop
</div>
</div>
<div>
<ul
class="ec-dropdown-search__item-list"
data-test="ec-dropdown-search__item-list"
>
<!--v-if-->
<!--v-if-->
</ul>
</div>
Expand Down
5 changes: 5 additions & 0 deletions src/components/ec-dropdown/ec-dropdown.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,11 @@ describe('EcDropdown', () => {
expect(wrapper.element).toMatchSnapshot();
});

it('should render properly when the bottomNote prop is set', () => {
const wrapper = mountDropdown({ bottomNote: 'Testing the bottomNote prop' });
expect(wrapper.element).toMatchSnapshot();
});

it('should render given popover style', () => {
const wrapper = mountDropdown({ popoverStyle: { width: '1234px' } });
expect(wrapper.element).toMatchSnapshot();
Expand Down

0 comments on commit 3f3e0f1

Please sign in to comment.