Skip to content
Closed
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
44 changes: 44 additions & 0 deletions .github/workflows/update-snapshots.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Update Snapshots

on:
workflow_dispatch:
inputs:
branch:
description: 'Branch to update snapshots on'
required: true
default: 'dev-fix'

jobs:
update-snapshots:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ github.event.inputs.branch }}
token: ${{ secrets.GITHUB_TOKEN }}

- name: Install pnpm
run: npm i -g --force corepack && corepack enable

- name: Set node version to 20
uses: actions/setup-node@v3
with:
node-version: '20.19.5'
cache: 'pnpm'

- name: Install dependencies
run: pnpm install --no-frozen-lockfile && node scripts/bootstrap.mjs

- name: Update snapshots
run: |
cd packages/varlet-ui
pnpm exec vitest run --config ../varlet-cli/lib/node/config/vitest.config.js -u

- name: Commit updated snapshots
run: |
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git add -A
git diff --staged --quiet || git commit -m "chore: update test snapshots [skip ci]"
git push
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,4 +64,4 @@
"tinyexec": "npm:tinyexec@^0.3.0"
}
}
}
}
Empty file modified packages/varlet-cli/lib/node/bin.js
100644 → 100755
Empty file.
2 changes: 1 addition & 1 deletion packages/varlet-cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -94,4 +94,4 @@
"engines": {
"node": "^14.18.0 || >=16.0.0"
}
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { App } from 'vue'

export const install: (app: App) => void
export declare const install: (app: App) => void

export * from './basicComponent'
export * from './button'
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { App } from 'vue'

export const install: (app: App) => void
export declare const install: (app: App) => void

export * from './basicComponent'
export * from './button'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,6 @@ interface Locale {
}
}

export const Locale: Locale
export declare const Locale: Locale

export class _LocaleComponent {}
2 changes: 1 addition & 1 deletion packages/varlet-icons/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,4 @@
"devDependencies": {
"@varlet/cli": "workspace:*"
}
}
}
2 changes: 1 addition & 1 deletion packages/varlet-import-resolver/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,4 @@
"tsup": "catalog:",
"typescript": "catalog:"
}
}
}
2 changes: 1 addition & 1 deletion packages/varlet-preset-tailwindcss/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,4 @@
"peerDependencies": {
"tailwindcss": "^3.4.1"
}
}
}
2 changes: 1 addition & 1 deletion packages/varlet-preset-unocss/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,4 @@
"peerDependencies": {
"unocss": "^0.58.5"
}
}
}
2 changes: 1 addition & 1 deletion packages/varlet-shared/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,4 @@
"tsup": "catalog:",
"typescript": "catalog:"
}
}
}
2 changes: 1 addition & 1 deletion packages/varlet-touch-emulator/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,4 @@
"devDependencies": {
"tsup": "catalog:"
}
}
}
2 changes: 1 addition & 1 deletion packages/varlet-ui-playground/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,4 @@
"typescript": "catalog:",
"vite": "catalog:"
}
}
}
2 changes: 1 addition & 1 deletion packages/varlet-ui-playground/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
"compilerOptions": {
"allowSyntheticDefaultImports": true,
"isolatedModules": true,
"types": ["vite/client"],
"types": ["vite/client"]
}
}
2 changes: 1 addition & 1 deletion packages/varlet-ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -81,4 +81,4 @@
"vue": "^3.2.0"
},
"web-types": "highlight/web-types.en-US.json"
}
}
4 changes: 3 additions & 1 deletion packages/varlet-ui/src/drag/__tests__/index.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,9 @@ test('drag click method', async () => {
},
})

await trigger(container.childNodes[1], 'click')
await delay(16)
const dragElement = container.querySelector('.var-drag')
await trigger(dragElement, 'click')
expect(onClick).toHaveBeenCalledTimes(1)

wrapper.unmount()
Expand Down
1 change: 1 addition & 0 deletions packages/varlet-ui/src/fab/__tests__/index.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,7 @@ test('fab events and fragment default slots and click outside close', async () =
},
})

await delay(16)
const button = container.querySelector('.var-button')
expect(container.innerHTML).toMatchSnapshot()
await trigger(button, 'click')
Expand Down
6 changes: 4 additions & 2 deletions packages/varlet-ui/src/result/__tests__/index.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,10 @@ describe('test result component props', () => {
},
})

expect(wrapper.find('.var-result__empty').attributes('style')).toContain('width: calc(90px)')
expect(wrapper.find('.var-result__empty').attributes('style')).toContain('height: calc(90px)')
const style = wrapper.find('.var-result__empty').attributes('style')
// Accept both unsimplified calc(100px * 0.9) and simplified calc(90px)
expect(style).toMatch(/width: calc\((100px \* 0\.9|90px)\)/)
expect(style).toMatch(/height: calc\((100px \* 0\.9|90px)\)/)

wrapper.unmount()
})
Expand Down
2 changes: 1 addition & 1 deletion packages/varlet-use/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,4 @@
"peerDependencies": {
"vue": "^3.2.0"
}
}
}
2 changes: 1 addition & 1 deletion packages/varlet-vite-plugins/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,4 @@
"peerDependencies": {
"vite": "catalog:"
}
}
}
2 changes: 1 addition & 1 deletion packages/varlet-vscode-extension/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -104,4 +104,4 @@
"vscode": "^1.56.0"
},
"icon": "assets/icon.png"
}
}
Loading