Skip to content

Commit

Permalink
feat: Visual regression tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Matthew Holloway authored and Matthew Holloway committed Oct 1, 2024
1 parent 85cb18f commit c26dbfc
Show file tree
Hide file tree
Showing 7 changed files with 2,631 additions and 77 deletions.
2 changes: 2 additions & 0 deletions client/.lostpixel/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
current
difference
28 changes: 28 additions & 0 deletions client/components/Card.story.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<template>
<Story
title="Card"
:layout="{
type: 'grid',
width: 200
}"
>
<Variant title="Regular card" :init-state="initState">
<Card href="/sdf" heading-level="3" has-cover-link>
<template #headingTitle>What is an RFC?</template>
<p class="text-base mt-2 text-blue-900 dark:text-white">
Short description of the page here if it seems useful to show
</p>
</Card>
</Variant>
</Story>
</template>

<script lang="ts" setup>
import Card from './Card.vue'
function initState() {
return {
disabled: false
}
}
</script>
7 changes: 7 additions & 0 deletions client/histoire.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { defineConfig } from 'histoire'
import { HstVue } from '@histoire/plugin-vue'
import { HstNuxt } from '@histoire/plugin-nuxt'

export default defineConfig({
plugins: [HstVue(), HstNuxt()]
})
9 changes: 9 additions & 0 deletions client/lostpixel.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import type { CustomProjectConfig } from 'lost-pixel'

export const config: CustomProjectConfig = {
histoireShots: {
histoireUrl: './.histoire/dist'
},
generateOnly: true,
failOnDifference: true
}
2 changes: 2 additions & 0 deletions client/nuxt.config.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
/// <reference types="histoire" />

// https://nuxt.com/docs/api/configuration/nuxt-config
export default defineNuxtConfig({
compatibilityDate: '2024-04-03',
Expand Down
Loading

0 comments on commit c26dbfc

Please sign in to comment.