commits.spec.ts — vue Source File
Architecture documentation for commits.spec.ts, a typescript file in the vue codebase. 4 imports, 0 dependents.
Entity Profile
Dependency Diagram
graph LR e561ba0f_2a52_096c_f7e8_21c7c7d94919["commits.spec.ts"] 89e1d5c3_816b_464a_8e3e_7496dffe6752["e2eUtils.ts"] e561ba0f_2a52_096c_f7e8_21c7c7d94919 --> 89e1d5c3_816b_464a_8e3e_7496dffe6752 29f97b51_38b6_0943_0c18_913d76c86b26["setupPuppeteer"] e561ba0f_2a52_096c_f7e8_21c7c7d94919 --> 29f97b51_38b6_0943_0c18_913d76c86b26 0409ae0b_e495_6959_8f5e_6f3562f01086["getExampleUrl"] e561ba0f_2a52_096c_f7e8_21c7c7d94919 --> 0409ae0b_e495_6959_8f5e_6f3562f01086 aa8b32b7_80a7_166e_5355_028de3715b60["commits.mock.ts"] e561ba0f_2a52_096c_f7e8_21c7c7d94919 --> aa8b32b7_80a7_166e_5355_028de3715b60 style e561ba0f_2a52_096c_f7e8_21c7c7d94919 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
// @vitest-environment node
import { setupPuppeteer, getExampleUrl, E2E_TIMEOUT } from './e2eUtils'
import mocks from './commits.mock'
describe('e2e: commits', () => {
const { page, click, count, text, isChecked } = setupPuppeteer()
async function testCommits(apiType: 'classic' | 'composition') {
// intercept and mock the response to avoid hitting the actual API
await page().setRequestInterception(true)
page().on('request', req => {
const match = req.url().match(/&sha=(.*)$/)
if (!match) {
req.continue()
} else {
const ret = JSON.stringify(mocks[match[1] as 'main' | 'dev'])
req.respond({
status: 200,
contentType: 'application/json',
headers: { 'Access-Control-Allow-Origin': '*' },
body: ret
})
}
})
await page().goto(getExampleUrl('commits', apiType))
await page().waitForSelector('li')
expect(await count('input')).toBe(2)
expect(await count('label')).toBe(2)
expect(await text('label[for="main"]')).toBe('main')
expect(await text('label[for="dev"]')).toBe('dev')
expect(await isChecked('#main')).toBe(true)
expect(await isChecked('#dev')).toBe(false)
expect(await text('p')).toBe('vuejs/vue@main')
expect(await count('li')).toBe(3)
expect(await count('li .commit')).toBe(3)
expect(await count('li .message')).toBe(3)
await click('#dev')
expect(await text('p')).toBe('vuejs/vue@dev')
expect(await count('li')).toBe(3)
expect(await count('li .commit')).toBe(3)
expect(await count('li .message')).toBe(3)
}
test(
'classic',
async () => {
await testCommits('classic')
},
E2E_TIMEOUT
)
test(
'composition',
async () => {
await testCommits('composition')
},
E2E_TIMEOUT
)
})
Domain
Source
Frequently Asked Questions
What does commits.spec.ts do?
commits.spec.ts is a source file in the vue codebase, written in typescript. It belongs to the VueCore domain.
What does commits.spec.ts depend on?
commits.spec.ts imports 4 module(s): commits.mock.ts, e2eUtils.ts, getExampleUrl, setupPuppeteer.
Where is commits.spec.ts in the architecture?
commits.spec.ts is located at test/e2e/commits.spec.ts (domain: VueCore, directory: test/e2e).
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free