Skip to content

Commit

Permalink
test: update import alias (#2977)
Browse files Browse the repository at this point in the history
  • Loading branch information
eiinu authored Mar 18, 2024
1 parent ac60b0d commit 29db146
Show file tree
Hide file tree
Showing 80 changed files with 130 additions and 179 deletions.
2 changes: 1 addition & 1 deletion src/packages/__VUE/actionsheet/__tests__/index.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { mount } from '@vue/test-utils';
import ActionSheet from '../index.vue';
import { ActionSheet } from '@nutui/nutui';
import { nextTick } from 'vue';

test('should render ActionSheet when visible is true', async () => {
Expand Down
2 changes: 1 addition & 1 deletion src/packages/__VUE/address/__tests__/address.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { mount } from '@vue/test-utils';
import { nextTick } from 'vue';
import Address from '../index.vue';
import { Address } from '@nutui/nutui';
import { addressListData, addressExistData } from '../address-list';

test('Address: address render', async () => {
Expand Down
3 changes: 1 addition & 2 deletions src/packages/__VUE/animate/__tests__/animate.spec.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { mount } from '@vue/test-utils';
import Animate from '../';
import { Animate, type AnimateType } from '@nutui/nutui';
import { nextTick } from 'vue';
import { AnimateType } from '../types';
import { sleep } from '@/packages/utils/unit';

const testType = [
Expand Down
3 changes: 1 addition & 2 deletions src/packages/__VUE/audio/__tests__/audio.spec.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { config, mount } from '@vue/test-utils';
import { nextTick, toRefs, reactive } from 'vue';
import Audio from '../index.vue';
import AudioOperate from '../../audiooperate/index.vue';
import { Audio, AudioOperate } from '@nutui/nutui';

beforeAll(() => {
config.global.components = {
Expand Down
3 changes: 1 addition & 2 deletions src/packages/__VUE/avatar/__tests__/avatar.spec.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { mount } from '@vue/test-utils';
import { h, nextTick } from 'vue';
import Avatar from '../index.vue';
import AvatarGroup from '../../avatargroup/index.vue';
import { Avatar, AvatarGroup } from '@nutui/nutui';

test('Avatar: size props', async () => {
const wrapper = mount(Avatar, {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import 'vitest-canvas-mock';
import { mount } from '@vue/test-utils';
import AvatarCropper from '../index.vue';
import { AvatarCropper } from '@nutui/nutui';
import { sleep, trigger, triggerDrag } from '@/packages/utils/unit';
import { h } from 'vue';

Expand Down
2 changes: 1 addition & 1 deletion src/packages/__VUE/backtop/__tests__/backtop.spec.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { mount, config } from '@vue/test-utils';
import Backtop from '../backtop.vue';
import { mockScrollTop } from './../../../utils/unit';
import { nextTick } from 'vue';
import { Backtop } from '@nutui/nutui';
import { Top } from '@nutui/icons-vue';
beforeAll(() => {
config.global.components = {
Expand Down
2 changes: 1 addition & 1 deletion src/packages/__VUE/badge/__tests__/badge.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import Badge from '../index.vue';
import { Badge } from '@nutui/nutui';
import { mount } from '@vue/test-utils';

test('should render nothing when content is empty string', () => {
Expand Down
2 changes: 1 addition & 1 deletion src/packages/__VUE/barrage/__tests__/barrage.spec.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { mount } from '@vue/test-utils';
import Barrage from '../index.vue';
import { Barrage } from '@nutui/nutui';

const list = ['画美不看', '不明觉厉', '喜大普奔', '男默女泪', '累觉不爱', '爷青结-'];

Expand Down
2 changes: 1 addition & 1 deletion src/packages/__VUE/button/__tests__/button.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { mount } from '@vue/test-utils';
import Button from '../';
import { Button } from '@nutui/nutui';
import { nextTick } from 'vue';
import { StarFill } from '@nutui/icons-vue';
test('emit click event', () => {
Expand Down
2 changes: 1 addition & 1 deletion src/packages/__VUE/calendar/__tests__/calendar.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { mount } from '@vue/test-utils';
import Calendar from '../index.vue';
import { Calendar } from '@nutui/nutui';
import { nextTick } from 'vue';

test('show-title prop', async () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { mount } from '@vue/test-utils';
import CalendarCard from '..';
import { CalendarCard, type CalendarCardDay } from '@nutui/nutui';
import { nextTick, ref } from 'vue';
import { CalendarCardDay } from '../types';

test('CalendarCard: test defaultValue mount(() => ', async () => {
const wrapper = mount(() => <CalendarCard modelValue={new Date('2023-01-25')} />);
Expand Down
2 changes: 1 addition & 1 deletion src/packages/__VUE/card/__tests__/index.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { DOMWrapper, mount } from '@vue/test-utils';
import Card from '../index.vue';
import { Card } from '@nutui/nutui';

test('Card: title props', () => {
const wrapper = mount(Card, {
Expand Down
2 changes: 1 addition & 1 deletion src/packages/__VUE/cascader/__tests__/cascader.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { CascaderOption } from './../types';
import { mount } from '@vue/test-utils';
import Cascader from '../index.vue';
import { Cascader } from '@nutui/nutui';
import Tree from '../tree';
import { formatTree, convertListToOptions } from '../helper';

Expand Down
3 changes: 1 addition & 2 deletions src/packages/__VUE/cell/__tests__/cell.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { mount } from '@vue/test-utils';
import { vi } from 'vitest';
import Cell from '../index.vue';
import { Cell } from '@nutui/nutui';
import { nextTick } from 'vue';

// mock module
Expand Down
2 changes: 1 addition & 1 deletion src/packages/__VUE/cellgroup/__tests__/index.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import CellGroup from '../index.vue';
import { CellGroup } from '@nutui/nutui';
import { mount } from '@vue/test-utils';
test('should render title、desc slot correctly', () => {
const wrapper = mount(CellGroup, {
Expand Down
2 changes: 1 addition & 1 deletion src/packages/__VUE/checkbox/__tests__/checkbox.spec.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { mount } from '@vue/test-utils';
import Checkbox from '../index.vue';
import { Checkbox } from '@nutui/nutui';
import { ref } from 'vue';

test('basic usage', () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { mount } from '@vue/test-utils';
import CheckboxGroup from '../index.vue';
import Checkbox from '../../checkbox/index.vue';
import { Checkbox, CheckboxGroup } from '@nutui/nutui';
import { ref } from 'vue';

test('CheckboxGroup: v-model & change', async () => {
Expand Down
8 changes: 4 additions & 4 deletions src/packages/__VUE/circleprogress/__tests__/index.spec.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { mount } from '@vue/test-utils';
import Circleprogress from '../';
import { CircleProgress } from '@nutui/nutui';

test('CircleProgress: should change stoke when use width props', async () => {
const wrapper = mount(Circleprogress, {
const wrapper = mount(CircleProgress, {
props: {
progress: 40,
strokeWidth: 10,
Expand All @@ -14,7 +14,7 @@ test('CircleProgress: should change stoke when use width props', async () => {
expect(element.style.height).toEqual('120px');
});
test('CircleProgress: should change color when use color props', async () => {
const wrapper = mount(Circleprogress, {
const wrapper = mount(CircleProgress, {
props: {
progress: 40,
color: 'red'
Expand All @@ -24,7 +24,7 @@ test('CircleProgress: should change color when use color props', async () => {
expect(path[1].html()).toContain('red');
});
test('CircleProgress: gradient', async () => {
const wrapper = mount(Circleprogress, {
const wrapper = mount(CircleProgress, {
props: {
progress: 40,
clockwise: false,
Expand Down
3 changes: 1 addition & 2 deletions src/packages/__VUE/col/__tests__/index.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import Col from '../';
import Row from '../../row';
import { Col, Row } from '@nutui/nutui';
import { mount } from '@vue/test-utils';

// 测试用例
Expand Down
3 changes: 1 addition & 2 deletions src/packages/__VUE/collapse/__tests__/collapse.spec.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import { mount } from '@vue/test-utils';
import { nextTick } from 'vue';
import { Heart } from '@nutui/icons-vue';
import Collapse from '../';
import CollapseItem from '../../collapseitem';
import { Collapse, CollapseItem } from '@nutui/nutui';

test('Collapse: should props active', async () => {
const wrapper = mount(() => {
Expand Down
2 changes: 1 addition & 1 deletion src/packages/__VUE/comment/__tests__/comment.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { mount } from '@vue/test-utils';
import { nextTick } from 'vue';
import Comment from '../index.vue';
import { Comment } from '@nutui/nutui';
import CommentData from '../comment_data.json';

test('comment init render', async () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { mount } from '@vue/test-utils';
import ConfigProvider from '../index.vue';
import { ConfigProvider } from '@nutui/nutui';
import { Close } from '@nutui/icons-vue';
import { h } from 'vue';

Expand Down
3 changes: 1 addition & 2 deletions src/packages/__VUE/countdown/__tests__/countdown.spec.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { mount } from '@vue/test-utils';
import { nextTick, toRefs, reactive } from 'vue';
import Countdown from '../index.vue';
import Button from '../../button';
import { Button, Countdown } from '@nutui/nutui';
import { sleep } from '@/packages/utils/unit';

test('endTime props', async () => {
Expand Down
2 changes: 1 addition & 1 deletion src/packages/__VUE/countup/__tests__/countup.spec.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { mount } from '@vue/test-utils';
import Countup from '../index.vue';
import { Countup } from '@nutui/nutui';
import { nextTick } from 'vue';
import { sleep } from '@/packages/utils/unit';

Expand Down
2 changes: 1 addition & 1 deletion src/packages/__VUE/datepicker/__tests__/datepicker.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { mount } from '@vue/test-utils';
import { nextTick } from 'vue';
import DatePicker from '../../datepicker/index.vue';
import { DatePicker } from '@nutui/nutui';

test('Do not display Chinese', async () => {
const wrapper = mount(DatePicker, {
Expand Down
2 changes: 1 addition & 1 deletion src/packages/__VUE/dialog/__tests__/index.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { mount } from '@vue/test-utils';
import Dialog from '../index.vue';
import { Dialog } from '@nutui/nutui';
import { nextTick } from 'vue';

beforeEach(() => {
Expand Down
2 changes: 1 addition & 1 deletion src/packages/__VUE/divider/__tests__/divider.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { mount } from '@vue/test-utils';
import Divider from '../';
import { Divider } from '@nutui/nutui';

test('Divider: default slot', () => {
const wrapper = mount(Divider, {
Expand Down
2 changes: 1 addition & 1 deletion src/packages/__VUE/drag/__tests__/index.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { mount } from '@vue/test-utils';
import Drag from '../index.vue';
import { Drag } from '@nutui/nutui';
import { triggerDrag, sleep } from '../../../utils/unit';

test('should render default slot correctly', () => {
Expand Down
2 changes: 1 addition & 1 deletion src/packages/__VUE/ecard/__tests__/index.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { DOMWrapper, mount } from '@vue/test-utils';
import Ecard from '../index.vue';
import { Ecard } from '@nutui/nutui';
import { nextTick } from 'vue';

const data = [
Expand Down
2 changes: 1 addition & 1 deletion src/packages/__VUE/elevator/__tests__/index.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { mount } from '@vue/test-utils';
import Elevator from '../index.vue';
import { Elevator } from '@nutui/nutui';

const indexList = [
{
Expand Down
2 changes: 1 addition & 1 deletion src/packages/__VUE/ellipsis/__tests__/ellipsis.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { mount } from '@vue/test-utils';
import { nextTick } from 'vue';
import Ellipsis from '../index.vue';
import { Ellipsis } from '@nutui/nutui';

const originGetComputedStyle = window.getComputedStyle;
const lineHeight = 19.5;
Expand Down
2 changes: 1 addition & 1 deletion src/packages/__VUE/empty/__tests__/index.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { mount } from '@vue/test-utils';
import Empty from '../../empty/index.vue';
import { Empty } from '@nutui/nutui';

test('Empty: should be shown when passing image and description', () => {
const wrapper = mount(Empty, {
Expand Down
2 changes: 1 addition & 1 deletion src/packages/__VUE/fixednav/__tests__/fixednav.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { mount } from '@vue/test-utils';
import FixedNav from '../index.vue';
import { FixedNav } from '@nutui/nutui';
import { nextTick } from 'vue';

describe('FixedNav', () => {
Expand Down
11 changes: 1 addition & 10 deletions src/packages/__VUE/form/__tests__/index.spec.tsx
Original file line number Diff line number Diff line change
@@ -1,15 +1,6 @@
import { DOMWrapper, mount } from '@vue/test-utils';
import { nextTick, ref } from 'vue';
import Form from '../';
import FormItem from '../../formitem';
import Textarea from '../../textarea/index.vue';
import Button from '../../button';
import Switch from '../../switch/index.vue';
import Checkbox from '../../checkbox/index.vue';
import Rate from '../../rate';
import InputNumber from '../../inputnumber';
import Range from '../../range/index.vue';
import Uploader from '../../uploader/index.vue';
import { Form, FormItem, Button, Textarea, Switch, Checkbox, Rate, InputNumber, Range, Uploader } from '@nutui/nutui';

test('base Form', () => {
const wrapper = mount(() => {
Expand Down
10 changes: 2 additions & 8 deletions src/packages/__VUE/grid/__tests__/grid.spec.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,7 @@
import { h, nextTick } from 'vue';
import { config, mount } from '@vue/test-utils';
import { vi } from 'vitest';
import { mount } from '@vue/test-utils';
import { useRouter } from 'vue-router';
import Grid from '../index.vue';
import GridItem from '../../griditem/index.vue';

afterAll(() => {
config.global.components = {};
});
import { Grid, GridItem } from '@nutui/nutui';

// mock module
vi.mock('vue-router', () => ({
Expand Down
2 changes: 1 addition & 1 deletion src/packages/__VUE/image/__tests__/image.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { config, mount } from '@vue/test-utils';
import ImagePage from '../index.vue';
import { Image as ImagePage } from '@nutui/nutui';
import { Loading, CircleClose, Image, ImageError } from '@nutui/icons-vue';
beforeAll(() => {
config.global.components = {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { mount } from '@vue/test-utils';
import ImagePreview from '../index.vue';
import { ImagePreview } from '@nutui/nutui';
import { nextTick } from 'vue';
import { sleep } from '@/packages/utils/unit';

Expand Down
2 changes: 1 addition & 1 deletion src/packages/__VUE/indicator/__tests__/indicator.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { mount } from '@vue/test-utils';
import Indicator from '../index.vue';
import { Indicator } from '@nutui/nutui';

test('Indicator: should be shown when passing size and current', async () => {
const wrapper = mount(Indicator, {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { mount } from '@vue/test-utils';
import InfiniteLoading from '../index.vue';
import { InfiniteLoading } from '@nutui/nutui';
import { toRefs, reactive, ref, onMounted } from 'vue';

test('infiniteloading base', async () => {
Expand Down
2 changes: 1 addition & 1 deletion src/packages/__VUE/input/__tests__/input.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { DOMWrapper, mount } from '@vue/test-utils';
import Input from '../index.vue';
import { Input } from '@nutui/nutui';
import { nextTick, ref } from 'vue';

test('base', () => {
Expand Down
2 changes: 1 addition & 1 deletion src/packages/__VUE/inputnumber/__tests__/index.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { mount } from '@vue/test-utils';
import InputNumber from '../';
import { InputNumber } from '@nutui/nutui';
import { h, nextTick } from 'vue';
import { Left, Right } from '@nutui/icons-vue';

Expand Down
2 changes: 1 addition & 1 deletion src/packages/__VUE/list/__tests__/list.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { mount } from '@vue/test-utils';
import List from '../index.vue';
import { List } from '@nutui/nutui';
import { nextTick } from 'vue';

test('should render height', async () => {
Expand Down
3 changes: 1 addition & 2 deletions src/packages/__VUE/menu/__tests__/menu.spec.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { config, mount } from '@vue/test-utils';
import Menu from '../index.vue';
import MenuItem from '../../menuitem/index.vue';
import { Menu, MenuItem } from '@nutui/nutui';
import { mockScrollTop } from './../../../utils/unit';
import { h, nextTick } from 'vue';

Expand Down
Loading

0 comments on commit 29db146

Please sign in to comment.