Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: bump @configurajs/eslint and update test cases #1845

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,7 @@ export default defineConfig({
'packages/varlet-import-resolver/lib/**',
'packages/varlet-touch-emulator/iife.js',
],
rules: {
'vitest/expect-expect': 'warn',
},
})
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
"*.{ts,tsx,js,vue}": "eslint --fix"
},
"devDependencies": {
"@configurajs/eslint": "^0.1.0",
"@configurajs/eslint": "^0.1.1",
"@configurajs/prettier": "^0.1.1",
"@varlet/cli": "workspace:*",
"@varlet/icons": "workspace:*",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html

exports[`test action-sheet styles 1`] = `
exports[`action-sheet styles 1`] = `
"<transition-stub name="var-fade" appear="false" persisted="false" css="true">
<div class="var--box var-popup" style="z-index: 1998;">
<div class="var-popup__overlay" style="z-index: 1999;"></div>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html

exports[`test safe area 1`] = `"<div data-v-app=""><!--teleport start--><!--teleport end--></div><div class="var--box var-popup var-fade-enter-from var-fade-enter-active" style="z-index: 1998;"><div class="var-popup__overlay" style="z-index: 1999;"></div><div class="var-popup__content var-popup--bottom var-popup--content-background-color var-elevation--3 var-popup--safe-area var-action-sheet__popup-radius var-pop-bottom-enter-from var-pop-bottom-enter-active" style="z-index: 2000;" role="dialog" aria-modal="true"><div class="var-action-sheet var--box"><div class="var-action-sheet__title">请选择</div><div class="var-action-sheet__action-item"><!--v-if--><div class="var-action-sheet__action-name">Item 01</div><div class="var-hover-overlay"></div></div></div></div></div>"`;
exports[`safe area 1`] = `"<div data-v-app=""><!--teleport start--><!--teleport end--></div><div class="var--box var-popup var-fade-enter-from var-fade-enter-active" style="z-index: 1998;"><div class="var-popup__overlay" style="z-index: 1999;"></div><div class="var-popup__content var-popup--bottom var-popup--content-background-color var-elevation--3 var-popup--safe-area var-action-sheet__popup-radius var-pop-bottom-enter-from var-pop-bottom-enter-active" style="z-index: 2000;" role="dialog" aria-modal="true"><div class="var-action-sheet var--box"><div class="var-action-sheet__title">请选择</div><div class="var-action-sheet__action-item"><!--v-if--><div class="var-action-sheet__action-name">Item 01</div><div class="var-hover-overlay"></div></div></div></div></div>"`;
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ import { expect, test } from 'vitest'
import VarActionSheet from '../ActionSheet'
import ActionSheet from '../index'

test('test action-sheet component plugin', () => {
test('action-sheet component plugin', () => {
const app = createApp({}).use(ActionSheet.Component)
expect(app.component(ActionSheet.Component.name)).toBeTruthy()
})

test('test action-sheet styles', () => {
test('action-sheet styles', () => {
const wrapper = mount(VarActionSheet, {
props: {
teleport: null,
Expand Down
12 changes: 6 additions & 6 deletions packages/varlet-ui/src/action-sheet/__tests__/index.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ import { delay, trigger } from '../../utils/test'
import VarActionSheet from '../ActionSheet'
import ActionSheet from '../index'

test('test action sheet plugin', () => {
test('action sheet plugin', () => {
const app = createApp({}).use(ActionSheet)
expect(app.component(VarActionSheet.name)).toBeTruthy()
})

test('test action sheet functional show & close', async () => {
test('action sheet functional show & close', async () => {
const onOpen = vi.fn()
const onOpened = vi.fn()
const onClose = vi.fn()
Expand Down Expand Up @@ -38,7 +38,7 @@ test('test action sheet functional show & close', async () => {
expect(document.querySelector('.var-popup')).toBeFalsy()
})

test('test action sheet functional onSelect', async () => {
test('action sheet functional onSelect', async () => {
const onSelect = vi.fn()

ActionSheet({
Expand All @@ -53,7 +53,7 @@ test('test action sheet functional onSelect', async () => {
ActionSheet.close()
})

test('test action sheet functional disabled', async () => {
test('action sheet functional disabled', async () => {
const onSelect = vi.fn()

ActionSheet({
Expand All @@ -74,7 +74,7 @@ test('test action sheet functional disabled', async () => {
await delay(300)
})

test('test setDefaultOptions and resetDefaultOptions', async () => {
test('setDefaultOptions and resetDefaultOptions', async () => {
const onSelect = vi.fn()
ActionSheet.setDefaultOptions({ onSelect })

Expand All @@ -98,7 +98,7 @@ test('test setDefaultOptions and resetDefaultOptions', async () => {
await delay(300)
})

test('test safe area', async () => {
test('safe area', async () => {
ActionSheet({
actions: [{ name: 'Item 01' }],
safeArea: true,
Expand Down
28 changes: 14 additions & 14 deletions packages/varlet-ui/src/alert/__tests__/index.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ import { describe, expect, test, vi } from 'vitest'
import Alert from '..'
import VarAlert from '../Alert'

test('test alert plugin', () => {
test('alert plugin', () => {
const app = createApp({}).use(Alert)
expect(app.component(Alert.name)).toBeTruthy()
})

describe('test alert component props', () => {
test('test alert title', async () => {
test('alert title', async () => {
const wrapper = mount(VarAlert, {
props: {
title: 'Pride And Prejudice',
Expand All @@ -34,7 +34,7 @@ describe('test alert component props', () => {
wrapper.unmount()
})

test('test alert type', () => {
test('alert type', () => {
const ICON_TYPE_MAP = {
success: 'checkbox-marked-circle',
warning: 'warning',
Expand All @@ -54,7 +54,7 @@ describe('test alert component props', () => {
})
})

test('test alert message', async () => {
test('alert message', async () => {
const wrapper = mount(VarAlert, {
props: {
message: 'Pride And Prejudice',
Expand All @@ -78,7 +78,7 @@ describe('test alert component props', () => {
wrapper.unmount()
})

test('test alert color', async () => {
test('alert color', async () => {
const wrapper = mount(VarAlert, {
props: {
color: 'red',
Expand All @@ -96,7 +96,7 @@ describe('test alert component props', () => {
wrapper.unmount()
})

test('test alert closeable', async () => {
test('alert closeable', async () => {
const wrapper = mount(VarAlert)

expect(wrapper.find('.var-alert--close').exists()).toBe(false)
Expand All @@ -110,7 +110,7 @@ describe('test alert component props', () => {
wrapper.unmount()
})

test('test alert variant', () => {
test('alert variant', () => {
;['tonal', 'outlined', 'standard'].forEach((variant) => {
const wrapper = mount(VarAlert, {
props: { variant },
Expand All @@ -122,7 +122,7 @@ describe('test alert component props', () => {
})
})

test('test alert elevation', async () => {
test('alert elevation', async () => {
const wrapper = mount(VarAlert)

expect(wrapper.find('.var-elevation--2').exists()).toBe(false)
Expand All @@ -144,7 +144,7 @@ describe('test alert component props', () => {
})

describe('test alert component events', () => {
test('test alert close', async () => {
test('alert close', async () => {
const onClose = vi.fn()
const wrapper = mount(VarAlert, {
props: {
Expand All @@ -166,7 +166,7 @@ describe('test alert component events', () => {
})

describe('test alert component slots', () => {
test('test alert icon slot', () => {
test('alert icon slot', () => {
const wrapper = mount(VarAlert, {
slots: {
icon: () => 'Pride And Prejudice',
Expand All @@ -178,7 +178,7 @@ describe('test alert component slots', () => {
wrapper.unmount()
})

test('test alert default slot', () => {
test('alert default slot', () => {
const wrapper = mount(VarAlert, {
slots: {
default: () => 'Pride And Prejudice',
Expand All @@ -190,7 +190,7 @@ describe('test alert component slots', () => {
wrapper.unmount()
})

test('test alert title slot', () => {
test('alert title slot', () => {
const wrapper = mount(VarAlert, {
slots: {
title: () => 'Pride And Prejudice',
Expand All @@ -202,7 +202,7 @@ describe('test alert component slots', () => {
wrapper.unmount()
})

test('test alert content slot', () => {
test('alert content slot', () => {
const wrapper = mount(VarAlert, {
slots: {
content: () => 'Pride And Prejudice',
Expand All @@ -214,7 +214,7 @@ describe('test alert component slots', () => {
wrapper.unmount()
})

test('test alert close icon slot', () => {
test('alert close icon slot', () => {
const wrapper = mount(VarAlert, {
props: {
closeable: true,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html

exports[`test app bar component props > test app bar image and image-linear-gradient 1`] = `
exports[`test app bar component props > app bar image and image-linear-gradient 1`] = `
"<div class="var-app-bar var--box var-elevation--3" style="background-position: center center; background-size: cover; z-index: 1;">
<div class="var-app-bar__toolbar">
<div class="var-app-bar__left">
Expand All @@ -15,7 +15,7 @@ exports[`test app bar component props > test app bar image and image-linear-grad
<!--v-if-->"
`;

exports[`test app bar slots > test app bar content slot 1`] = `
exports[`test app bar slots > app bar content slot 1`] = `
"<div class="var-app-bar var--box var-elevation--3" style="z-index: 1;">
<div class="var-app-bar__toolbar">
<div class="var-app-bar__left">
Expand Down
32 changes: 16 additions & 16 deletions packages/varlet-ui/src/app-bar/__tests__/index.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ import { describe, expect, test } from 'vitest'
import AppBar from '..'
import VarAppBar from '../AppBar'

test('test app bar use', () => {
test('app bar use', () => {
const app = createApp({}).use(AppBar)
expect(app.component(AppBar.name)).toBeTruthy()
})

describe('test app bar component props', () => {
test('test app bar color', () => {
test('app bar color', () => {
const wrapper = mount(VarAppBar, {
props: {
color: 'red',
Expand All @@ -21,7 +21,7 @@ describe('test app bar component props', () => {
wrapper.unmount()
})

test('test app bar round', () => {
test('app bar round', () => {
const wrapper = mount(VarAppBar, {
props: {
round: true,
Expand All @@ -32,7 +32,7 @@ describe('test app bar component props', () => {
wrapper.unmount()
})

test('test app bar border', () => {
test('app bar border', () => {
const wrapper = mount(VarAppBar, {
props: {
border: true,
Expand All @@ -43,7 +43,7 @@ describe('test app bar component props', () => {
wrapper.unmount()
})

test('test app bar textColor', () => {
test('app bar textColor', () => {
const wrapper = mount(VarAppBar, {
props: {
textColor: 'red',
Expand All @@ -54,7 +54,7 @@ describe('test app bar component props', () => {
wrapper.unmount()
})

test('test app bar title', () => {
test('app bar title', () => {
const wrapper = mount(VarAppBar, {
props: {
title: 'text',
Expand All @@ -65,7 +65,7 @@ describe('test app bar component props', () => {
wrapper.unmount()
})

test('test app bar titlePosition', async () => {
test('app bar titlePosition', async () => {
const wrapper = mount(VarAppBar, {
props: {
titlePosition: 'left',
Expand All @@ -88,7 +88,7 @@ describe('test app bar component props', () => {
wrapper.unmount()
})

test('test app bar elevation', async () => {
test('app bar elevation', async () => {
const wrapper = mount(VarAppBar, {
props: {
elevation: true,
Expand All @@ -105,7 +105,7 @@ describe('test app bar component props', () => {
wrapper.unmount()
})

test('test app bar image and image-linear-gradient', () => {
test('app bar image and image-linear-gradient', () => {
const wrapper = mount(VarAppBar, {
props: {
image: 'https://1.png',
Expand All @@ -116,7 +116,7 @@ describe('test app bar component props', () => {
expect(wrapper.html()).toMatchSnapshot()
})

test('test app bar fixed', async () => {
test('app bar fixed', async () => {
const wrapper = mount(VarAppBar)

expect(wrapper.find('.var-app-bar--fixed').exists()).toBe(false)
Expand All @@ -130,7 +130,7 @@ describe('test app bar component props', () => {
wrapper.unmount()
})

test('test app-bar placeholder', async () => {
test('app-bar placeholder', async () => {
const wrapper = mount(VarAppBar, {
props: {
placeholder: true,
Expand All @@ -147,7 +147,7 @@ describe('test app bar component props', () => {
wrapper.unmount()
})

test('test app bar z-index', async () => {
test('app bar z-index', async () => {
const wrapper = mount(VarAppBar)

expect(wrapper.find('.var-app-bar').attributes('style')).toContain('z-index: 1')
Expand All @@ -163,7 +163,7 @@ describe('test app bar component props', () => {
})

describe('test app bar slots', () => {
test('test app bar default slot', () => {
test('app bar default slot', () => {
const wrapper = mount(VarAppBar, {
slots: {
default: () => 'This is default slot',
Expand All @@ -175,7 +175,7 @@ describe('test app bar slots', () => {
wrapper.unmount()
})

test('test app bar left slot', () => {
test('app bar left slot', () => {
const wrapper = mount(VarAppBar, {
slots: {
left: () => 'This is left slot',
Expand All @@ -187,7 +187,7 @@ describe('test app bar slots', () => {
wrapper.unmount()
})

test('test app bar right slot', () => {
test('app bar right slot', () => {
const wrapper = mount(VarAppBar, {
slots: {
right: () => 'This is right slot',
Expand All @@ -199,7 +199,7 @@ describe('test app bar slots', () => {
wrapper.unmount()
})

test('test app bar content slot', () => {
test('app bar content slot', () => {
const wrapper = mount(VarAppBar, {
slots: {
content: () => 'This is content slot',
Expand Down
Loading
Loading