mirror of
https://gitee.com/element-plus/element-plus.git
synced 2024-11-29 17:58:08 +08:00
style: update es-lint check
This commit is contained in:
parent
e1f61af8f9
commit
2c80f15a81
@ -9,7 +9,7 @@
|
||||
"storybook": "start-storybook",
|
||||
"bootstrap": "yarn && npx lerna bootstrap",
|
||||
"build": "yarn bootstrap && yarn build-storybook",
|
||||
"lint": "eslint . --ext .vue,.js,.ts"
|
||||
"lint": "eslint ./packages --ext .vue,.js,.ts"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"vue": "^3.0.0-rc.1"
|
||||
|
@ -1,4 +1,4 @@
|
||||
import {mount} from '@vue/test-utils'
|
||||
import { mount } from '@vue/test-utils'
|
||||
import Badge from '../src/index.vue'
|
||||
|
||||
const AXIOM = 'Rem is the best girl'
|
||||
@ -6,32 +6,32 @@ const AXIOM = 'Rem is the best girl'
|
||||
describe('Badge', () => {
|
||||
test('has value', () => {
|
||||
const wrapper = mount(Badge, {
|
||||
props: {value: 80},
|
||||
props: { value: 80 },
|
||||
})
|
||||
expect(wrapper.vm.content).toEqual(80)
|
||||
})
|
||||
|
||||
test('is fixed', () => {
|
||||
const wrapper = mount(Badge, {
|
||||
slots: {default: AXIOM},
|
||||
slots: { default: AXIOM },
|
||||
})
|
||||
expect(wrapper.find('.el-badge__content.is-fixed')).toBeDefined()
|
||||
})
|
||||
|
||||
test('is dot', () => {
|
||||
const wrapper = mount(Badge, {
|
||||
props: {isDot: true},
|
||||
slots: {default: AXIOM},
|
||||
props: { isDot: true },
|
||||
slots: { default: AXIOM },
|
||||
})
|
||||
expect(wrapper.find('.el-badge__content.is-fixed')).toBeDefined()
|
||||
})
|
||||
|
||||
test('max', async () => {
|
||||
const wrapper = mount(Badge, {
|
||||
props: {max: 100, value: 200},
|
||||
props: { max: 100, value: 200 },
|
||||
})
|
||||
expect(wrapper.vm.content).toEqual('100+')
|
||||
await wrapper.setProps({value: 80})
|
||||
await wrapper.setProps({ value: 80 })
|
||||
expect(wrapper.vm.content).toEqual(80)
|
||||
})
|
||||
})
|
||||
|
@ -1,4 +1,4 @@
|
||||
export { default as BasicUsage} from './basic.vue'
|
||||
export { default as BasicUsage } from './basic.vue'
|
||||
|
||||
export default {
|
||||
title: 'Badge',
|
||||
|
@ -20,7 +20,7 @@
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import {computed} from 'vue'
|
||||
import { computed } from 'vue'
|
||||
|
||||
interface IBadgeProps {
|
||||
value: string | number;
|
||||
@ -59,7 +59,7 @@ export default {
|
||||
if (props.isDot) {
|
||||
return
|
||||
}
|
||||
const {value, max} = props
|
||||
const { value, max } = props
|
||||
if (typeof value === 'number' && typeof max === 'number') {
|
||||
return max < value ? `${max}+` : value
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
import {mount} from '@vue/test-utils'
|
||||
import { mount } from '@vue/test-utils'
|
||||
import Tag from '../src/index.vue'
|
||||
|
||||
const AXIOM = 'Rem is the best girl'
|
||||
|
@ -1,4 +1,4 @@
|
||||
export { default as BasicUsage} from './basic.vue'
|
||||
export { default as BasicUsage } from './basic.vue'
|
||||
|
||||
export default {
|
||||
title: 'Tag',
|
||||
|
Loading…
Reference in New Issue
Block a user