This repository has been archived by the owner on Oct 6, 2023. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
34 changed files
with
353 additions
and
59 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
import './src/style.css' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
// import { describe, test, expect } from '@peeky/test' | ||
import { mount } from '@vue/test-utils' | ||
import Meow from './Meow.vue' | ||
|
||
test('meow', async () => { | ||
const wrapper = mount(Meow) | ||
|
||
expect(wrapper.html()).toMatchSnapshot() | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<template> | ||
<button class="meow"> | ||
Meow | ||
</button> | ||
</template> | ||
|
||
<style scoped> | ||
.meow { | ||
background: cyan; | ||
border: none; | ||
border-radius: 6px; | ||
padding: 4px 8px; | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
// Peeky snapshots v1.0 | ||
|
||
exports[`Meow meow 1`] = ` | ||
<button class="meow"> | ||
Meow | ||
</button> | ||
`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
html, | ||
body { | ||
background: #ebf1f1; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,5 +7,8 @@ export default defineConfig({ | |
], | ||
test: { | ||
runtimeEnv: 'dom', | ||
previewSetupFiles: [ | ||
'histoire-preview.ts', | ||
], | ||
}, | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,6 +12,7 @@ fragment runTestFileList on RunTestFile { | |
relativePath | ||
deleted | ||
} | ||
envName | ||
} | ||
` | ||
</script> | ||
|
42 changes: 42 additions & 0 deletions
42
packages/peeky-client/src/features/test/TestDomPreview.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
<script lang="ts" setup> | ||
import { defineProps } from 'vue' | ||
import { getIframeHtml } from '../../util/preview' | ||
import BaseSplitPane from '../BaseSplitPane.vue' | ||
import CodeEditor from '../editor/CodeEditor.vue' | ||
const props = defineProps({ | ||
test: { | ||
type: Object, | ||
required: true, | ||
}, | ||
suite: { | ||
type: Object, | ||
required: true, | ||
}, | ||
}) | ||
</script> | ||
|
||
<template> | ||
<BaseSplitPane | ||
:default-split="50" | ||
:min="20" | ||
:max="80" | ||
save-id="peeky-test-dom-preview" | ||
class="h-full" | ||
> | ||
<template #first> | ||
<CodeEditor | ||
:code="props.test.envResult?.html || ''" | ||
class="h-full" | ||
/> | ||
</template> | ||
<template #last> | ||
<iframe | ||
class="w-full h-full" | ||
:srcdoc="getIframeHtml(props.test.envResult?.html ?? '', props.test.previewImports)" | ||
/> | ||
</template> | ||
</BaseSplitPane> | ||
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.