forked from yuhonas/free-exercise-db
-
Notifications
You must be signed in to change notification settings - Fork 0
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
3 changed files
with
34 additions
and
12 deletions.
There are no files selected for viewing
22 changes: 22 additions & 0 deletions
22
site/src/components/__tests__/ExerciseInstructions.spec.js
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,22 @@ | ||
import { describe, it, expect } from 'vitest' | ||
|
||
import { mount } from '@vue/test-utils' | ||
import ExerciseInstructions from '../ExerciseInstructions.vue' | ||
|
||
describe('ExerciseInstructions', () => { | ||
// when passed an array of text it will render it inside a paragraph | ||
it('renders a single paragraph in non expanded form', () => { | ||
const instructions = [ | ||
'This is the first instruction', | ||
'This is the second instruction', | ||
'This is the third instruction' | ||
] | ||
const wrapper = mount(ExerciseInstructions, { | ||
props: { text: instructions } | ||
}) | ||
|
||
let paragraphs = wrapper.findAll('p') | ||
expect(paragraphs.length).toBe(1) | ||
expect(paragraphs.at(0).text()).toBe(instructions[0]) | ||
}) | ||
}) |
This file was deleted.
Oops, something went wrong.
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,12 @@ | ||
import { describe, it, expect } from 'vitest' | ||
|
||
import { mount } from '@vue/test-utils' | ||
import PhotoGallery from '../PhotoGallery.vue' | ||
|
||
describe('PhotoGallery', () => { | ||
it.skip('when passed an array of photos it should render properly', () => { | ||
const wrapper = mount(PhotoGallery, { props: { photos: ['example.jpg'] } }) | ||
// it should render an image with example.jpg as the src | ||
expect(wrapper.find('img').attributes('src')).toBe('example.jpg') | ||
}) | ||
}) |