Skip to content

Commit

Permalink
test: field
Browse files Browse the repository at this point in the history
  • Loading branch information
cole committed Jun 20, 2024
1 parent 51adca7 commit f1837b7
Show file tree
Hide file tree
Showing 8 changed files with 448 additions and 671 deletions.
1,095 changes: 436 additions & 659 deletions src/packages/base-field/__tests__/BaseField.test.jsx

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions src/packages/base-field/__tests__/CustomFields.test.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { mount } from '@vue/test-utils'
import { describe, expect, it, vi } from 'vitest'
import { mount } from '@vue/test-utils'
import BaseField, { CustomFields } from '../index'
import mountTest from '../../../../tests/shared/mountTest'

Expand All @@ -12,7 +12,7 @@ describe('CustomFields', () => {
}
}

it('props valueTypeMap and slots', async () => {
it(`props valueTypeMap and slots`, async () => {
const testSpy = vi.spyOn(valueTypeMap, 'test')

const wrapper = mount(CustomFields, {
Expand Down
6 changes: 3 additions & 3 deletions src/packages/descriptions/__tests__/Descriptions.test.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ import Descriptions from '../index'
import { Tooltip } from 'ant-design-vue'

describe('Descriptions', () => {
it('render', async () => {
it(`render`, async () => {
const wrapper = mount(Descriptions)
expect(wrapper.exists()).toBeTruthy()
})

it('props', async () => {
it(`props`, async () => {
const wrapper = mount(Descriptions, {
props: {
title: 'Test',
Expand Down Expand Up @@ -43,7 +43,7 @@ describe('Descriptions', () => {
wrapper.unmount()
})

it('props columns', async () => {
it(`props columns`, async () => {
const wrapper = mount(Descriptions, {
props: {
title: () => 'Test',
Expand Down
2 changes: 1 addition & 1 deletion src/packages/form/__tests__/Form.test.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { describe, expect, it } from 'vitest'
import { Form, Text } from '../index'

describe('Form', () => {
it('render', async () => {
it(`render`, async () => {
const wrapper = mount(Form, {
slots: {
default: () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import LocaleProvider, { useLocaleReceiver } from '../index'
import enUS from '../lang/en-US'

describe('LocaleProvider', () => {
it('render', async () => {
it(`render`, async () => {
const wrapper = mount(LocaleProvider, {
slots: {
default: () => {
Expand All @@ -19,7 +19,7 @@ describe('LocaleProvider', () => {
expect(wrapper.exists()).toBeTruthy()
})

it('translate path', () => {
it(`translate path`, () => {
const wrapper = mount(LocaleProvider, {
slots: {
default: () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { describe, expect, it } from 'vitest'
import ResizeObserver from '../index'

describe('ResizeObserver', () => {
it('render', async () => {
it(`render`, async () => {
const wrapper = mount(ResizeObserver, {
slots: {
default: () => {
Expand Down
4 changes: 2 additions & 2 deletions src/packages/table/__tests__/Table.test.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import ColumnSetting from '../components/column-setting'
import { Tooltip } from 'ant-design-vue'

describe('Table', () => {
it('render', async () => {
it(`render`, async () => {
const wrapper = mount(Table, {
props: {
columns: [
Expand Down Expand Up @@ -33,7 +33,7 @@ describe('Table', () => {
button.trigger('click')
})

it('render slots', async () => {
it(`render slots`, async () => {
const wrapper = mount(Table, {
props: {
columns: [
Expand Down
2 changes: 1 addition & 1 deletion tests/shared/mountTest.jsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { mount } from '@vue/test-utils'
import { describe, expect, it } from 'vitest'

function mountTest (Component) {
function mountTest (Component, ) {
describe(`mount and unmount`, () => {
it(`component could be updated and unmounted without errors`, () => {
const wrapper = mount(() => <Component/>, {
Expand Down

0 comments on commit f1837b7

Please sign in to comment.