Skip to content

Commit

Permalink
fix: textarea单元测试优化 (jd-opensource#481)
Browse files Browse the repository at this point in the history
Co-authored-by: guoxiaoxiao8 <[email protected]>
  • Loading branch information
guoxiao158 and guoxiaoxiao8 authored Jun 2, 2021
1 parent e5cdfcd commit bb90afa
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
8 changes: 7 additions & 1 deletion src/packages/__VUE/cell/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
<script lang="ts">
import { computed } from 'vue';
import { createComponent } from '@/packages/utils/create';
import { useRouter } from 'vue-router';
import { useRoute, useRouter } from 'vue-router';
import CellGroup from '@/packages/__VUE/cellgroup/index.vue';
const { componentName, create } = createComponent('cell');
export default create({
Expand Down Expand Up @@ -66,8 +66,14 @@ export default create({
const router = useRouter();
const handleClick = (event: Event) => {
emit('click', event);
if (props.to && router) {
router[props.replace ? 'replace' : 'push'](props.to);
// if(props.replace){
// router.replace(props.to)
// }else{
// router.push(props.to)
// }
} else if (props.url) {
props.replace
? location.replace(props.url)
Expand Down
2 changes: 0 additions & 2 deletions src/packages/__VUE/navbar/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@
<script lang="ts">
import { computed, ref } from 'vue';
import { createComponent } from '@/packages/utils/create';
import { useRouter } from 'vue-router';
const { componentName, create } = createComponent('navbar');
export default create({
props: {
Expand Down Expand Up @@ -104,7 +103,6 @@ export default create({
[prefixCls]: true
};
});
const router = useRouter();
function switchTitle(id: number, name: string) {
activeIndex.value = id;
Expand Down
2 changes: 1 addition & 1 deletion src/packages/__VUE/textarea/__tests__/textarea.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { mount } from '@vue/test-utils';
import Textarea from '../index.vue';

test('Textarea base', () => {
const wrapper = mount(Textarea);
//const wrapper = mount(Textarea);
// const input = wrapper.find('input');
// expect(input.exists()).toBe(true);
// expect(input.element.value).toBe("3");
Expand Down

0 comments on commit bb90afa

Please sign in to comment.