Skip to content

Commit

Permalink
update hello world test and snapshot
Browse files Browse the repository at this point in the history
  • Loading branch information
dariuszsikorski committed Aug 25, 2024
1 parent f14a798 commit 156180a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 11 deletions.
13 changes: 3 additions & 10 deletions tests/unit/views/HelloWorld.test.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
import testHelpers from '@@/unit/testHelpers.js';
import HelloWorld from '@/views/HelloWorld.vue';

function normalizeAmp(html) {
return html.replace(/&/g, '&');
}

describe('HelloWorld.vue', () => {
const setupWrapper = async () => {
const wrapper = await testHelpers.shallowMount(HelloWorld);
Expand All @@ -14,9 +10,7 @@ describe('HelloWorld.vue', () => {
describe('Desktop', () => {
test('Render default contents', async () => {
const wrapper = await setupWrapper();
const normalizedHtml = normalizeAmp(wrapper.html());

expect(normalizedHtml).toMatchSnapshot();
expect(wrapper.html()).toMatchSnapshot();
});

test('App name and message displays correctly', async () => {
Expand Down Expand Up @@ -57,9 +51,8 @@ describe('HelloWorld.vue', () => {

test('Render default contents', async () => {
const wrapper = await setupWrapper();
const normalizedHtml = normalizeAmp(wrapper.html());

expect(normalizedHtml).toMatchSnapshot();
expect(wrapper.html())
.toMatchSnapshot();
});

test('Message displays correctly', async () => {
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/views/__snapshots__/HelloWorld.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ exports[`HelloWorld.vue > Desktop > Render default contents 1`] = `
<img alt="Vue logo" src="/src/assets/logo.svg">
</div>
<h1 class="green">Your App Name Here</h1>
<h2 class="green">NW.js & Vue Boilerplate</h2>
<h2 class="green">NW.js &amp; Vue Boilerplate</h2>
<h3> This boilerplate uses <external-link-stub name="NW.js" url="nwjs.io"></external-link-stub> + <external-link-stub name="Vite" url="vitejs.dev"></external-link-stub> + <external-link-stub name="Vue 3" url="vuejs.org"></external-link-stub> + <external-link-stub name="Pinia" url="pinia.vuejs.org"></external-link-stub> + <external-link-stub name="Vue-Router" url="router.vuejs.org"></external-link-stub> + the <external-link-stub name="superior Options API" url="docs.google.com/presentation/d/1fsDhn_MptD6c-_ALgurQtvaRFkfbfukbbFGfEfckzvk/edit?usp=sharing"></external-link-stub>. </h3>
<div class="center mt-1">
<p class="container">
Expand Down

0 comments on commit 156180a

Please sign in to comment.