mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-09-18 06:49:47 +02:00
Adding image snapshots for graphs
This commit is contained in:
@@ -1,10 +1,23 @@
|
||||
/* eslint-env jest */
|
||||
describe('Google', () => {
|
||||
beforeAll(async () => {
|
||||
await page.goto('https://google.com')
|
||||
})
|
||||
import mermaidUrl from '../helpers/util.js'
|
||||
const { toMatchImageSnapshot } = require('jest-image-snapshot')
|
||||
|
||||
it('should be titled "Google"', async () => {
|
||||
await expect(page.title()).resolves.toMatch('Google')
|
||||
expect.extend({ toMatchImageSnapshot })
|
||||
|
||||
describe('Google', () => {
|
||||
it('should apa', async () => {
|
||||
const url = mermaidUrl(`graph TD
|
||||
A[Christmas] -->|Get money| B(Go shopping)
|
||||
B --> C{Let me think}
|
||||
C -->|One| D[Laptop]
|
||||
C -->|Two| E[iPhone]
|
||||
C -->|Three| F[fa:fa-car Car]
|
||||
`, {})
|
||||
|
||||
await page.goto(url)
|
||||
|
||||
const image = await page.screenshot()
|
||||
|
||||
expect(image).toMatchImageSnapshot()
|
||||
})
|
||||
})
|
||||
|
Reference in New Issue
Block a user