Skip to content

feat(runtime-core): useId() #11404

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

Merged
merged 3 commits into from
Jul 19, 2024
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
test: add test for config.idPrefix
  • Loading branch information
yyx990803 committed Jul 19, 2024
commit 020bdf39ef4bc1c2dde11cb228300ebe38ca4e6a
10 changes: 10 additions & 0 deletions packages/runtime-core/__tests__/helpers/useId.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,16 @@ describe('useId', () => {
).toBe('v0:0 v0:1')
})

test('with config.idPrefix', async () => {
expect(
await getOutput(() => {
const app = createApp(BasicComponentWithUseId)
app.config.idPrefix = 'foo-'
return [app, []]
}),
).toBe('foo-0:0 foo-0:1')
})

test('async component', async () => {
const factory = (
delay1: number,
Expand Down