Skip to content

Commit

Permalink
fix tests with component
Browse files Browse the repository at this point in the history
  • Loading branch information
practicatto committed Mar 26, 2024
1 parent 51ba76a commit df8c51c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 3 additions & 1 deletion docs/pages/playground.vue
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,16 @@
/> -->

<!-- Play around with your component here: -->
<!--<KTextbox :clearable="true" :textArea="true" label="labelll" />-->

</div>

</template>


<script>
import KTextbox from '../../lib/KTextbox/index.vue';
//import KTextbox from '../../lib/KTextbox/index.vue';
/*
Playground is a Vue component too,
Expand Down
4 changes: 2 additions & 2 deletions lib/KTextbox/__tests__/KTextbox.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ describe('KTextbox with clearable', () => {
input.element.value = 'test';
input.trigger('input');
await wrapper.vm.$nextTick();
const clearButton = wrapper.find('.ui-clear-button');
const clearButton = wrapper.findComponent({ name: 'KIconButton' });
expect(clearButton.exists()).toBeTruthy();
});

Expand All @@ -182,7 +182,7 @@ describe('KTextbox with clearable', () => {
input.element.value = 'test';
input.trigger('input');
await wrapper.vm.$nextTick();
const clearButton = wrapper.find('.ui-clear-button');
const clearButton = wrapper.findComponent({ name: 'KIconButton' });
clearButton.trigger('click');
await wrapper.vm.$nextTick();
expect(wrapper.find('input').element.value).toBe('');
Expand Down

0 comments on commit df8c51c

Please sign in to comment.