Skip to content

Commit

Permalink
test: 更新单元测试依赖版本 修复部分组件警告错误信息
Browse files Browse the repository at this point in the history
  • Loading branch information
Tyh2001 committed Apr 15, 2024
1 parent 080a9a1 commit 373de09
Show file tree
Hide file tree
Showing 11 changed files with 690 additions and 235 deletions.
47 changes: 24 additions & 23 deletions CONTRIBUTING.en-US.md

Large diffs are not rendered by default.

47 changes: 24 additions & 23 deletions CONTRIBUTING.md

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
"typescript": "^4.7.4",
"vite": "^4.3.9",
"vite-plugin-dts": "^2.3.0",
"vitest": "^0.32.2",
"vitest": "^1.5.0",
"vue-tsc": "^1.8.0"
},
"license": "MIT",
Expand All @@ -78,4 +78,4 @@
"eslint --fix"
]
}
}
}
5 changes: 4 additions & 1 deletion packages/fighting-design/calendar/__test__/calendar.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@ import { FCalendar } from '../index'

describe('Calendar', () => {
test('class', () => {
const wrapper = mount(FCalendar)
const wrapper = mount(FCalendar,
{
props: { date: new Date() }
})
expect(wrapper.classes()).toContain('f-calendar')
})
})
3 changes: 3 additions & 0 deletions packages/fighting-design/calendar/src/calendar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
import { Props } from './props'
import { computed, watch, reactive, onUnmounted } from 'vue'
import { FSvgIcon } from '../../svg-icon'
import { FOption } from '../../option'
import { FSelect } from '../../select'
import { FButton } from '../../button'
import { FIconChevronLeft, FIconChevronRight } from '../../_svg'
import { isDate } from '../../_utils'
import { useCalendar, useRun, useGlobal, useList } from '../../_hooks'
Expand Down
14 changes: 7 additions & 7 deletions packages/fighting-design/date-picker/src/date-picker.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import { FCalendar } from '../../calendar'
import { addZero, warning } from '../../_utils'
import { FIconCalendar } from '../../_svg'
import { FButton } from '../../button'
import type { TriggerInstance } from '../../trigger'
defineOptions({ name: 'FDatePicker' })
Expand All @@ -18,7 +19,12 @@
/** 传递给日历组件的当前时间 */
const date = new Date()
/**
* 格式化规则
*
* 字符串中必须包含 YYYY 或者 MM 或者 DD
*/
const formatRule = RegExp(/([Y]{4})|([M]{2})|([D]{2})/)
/** trigger 组件实例 */
const triggerInstance = ref<TriggerInstance>()
Expand All @@ -37,12 +43,6 @@
* 设置时间
*/
const setDate = (): void => {
/**
* 格式化规则
*
* 字符串中必须包含 YYYY 或者 MM 或者 DD
*/
const formatRule = RegExp(/([Y]{4})|([M]{2})|([D]{2})/)
/** 格式化规范 */
let format = prop.format
Expand Down
1 change: 1 addition & 0 deletions packages/fighting-design/submenu/src/submenu.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import { FSvgIcon } from '../../svg-icon'
import { inject, ref } from 'vue'
import { FIconChevronDown } from '../../_svg'
import { FCollapseAnimation } from '../../collapse-animation'
import type { MenuProvide } from '../../menu'
defineOptions({ name: 'FSubmenu' })
Expand Down
1 change: 1 addition & 0 deletions packages/fighting-design/time-picker/src/time-picker.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import { Props } from './props'
import { reactive, ref, nextTick, watch } from 'vue'
import { FInput } from '../../input'
import { FButton } from '../../button'
import { FTrigger } from '../../trigger'
import { addZero, isString, isBoolean } from '../../_utils'
import { FIconClockTime } from '../../_svg'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import { useRun } from '../../../_hooks'
import { FCheckbox } from '../../../checkbox'
import { isNumber } from '../../../_utils'
import { FCollapseAnimation } from '../../../collapse-animation'
import type { TreeItemModel } from './interface'
import type { CSSProperties } from 'vue'
import type { TreeProvide } from '../../index'
Expand Down
2 changes: 1 addition & 1 deletion packages/fighting-design/tree/src/tree.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<script lang="ts" setup>
import { Props, TREE_PROPS_KEY } from './props'
import { provide, toRef, reactive, ref } from 'vue'
import { FTreeItem } from '../components'
import FTreeItem from '../components/tree-item/index.vue'
import { isArray, isObject } from '../../_utils'
import { FCheckboxGroup } from '../../checkbox-group'
import type { TreeData, TreeProvide, TreeDataItem } from './interface'
Expand Down
Loading

0 comments on commit 373de09

Please sign in to comment.