-
Notifications
You must be signed in to change notification settings - Fork 2
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
domq077
committed
Dec 31, 2020
1 parent
a768b6b
commit 49e7a58
Showing
3 changed files
with
29 additions
and
4 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
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 |
---|---|---|
@@ -1,5 +1,3 @@ | ||
@import './components/redButton.css'; | ||
|
||
body { | ||
font-family: 'Montserrat', sans-serif; | ||
} | ||
|
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,26 @@ | ||
import { redButton } from '../src/app/redButton' | ||
import { screen } from '@testing-library/dom' | ||
import '@testing-library/jest-dom/extend-expect'; | ||
|
||
test('button has class button button--red button--uppercase', () => { | ||
document.body.innerHTML = `<div id="swquiz-app"></div>`; | ||
const testText = 'play the game'; | ||
redButton(testText); | ||
expect(screen.getByTestId('red-button')).toHaveClass('button button--red button--uppercase'); | ||
}) | ||
|
||
test('button has text', () => { | ||
document.body.innerHTML = `<div id="swquiz-app"></div>`; | ||
const testText = 'play the game'; | ||
redButton(testText); | ||
expect(screen.getByTestId('red-button')).not.toBeEmptyDOMElement(); | ||
}) | ||
|
||
test('button has text - play the game', () => { | ||
document.body.innerHTML = `<div id="swquiz-app"></div>`; | ||
const testText = 'play the game'; | ||
redButton(testText); | ||
expect(screen.getByTestId('red-button')).toHaveTextContent('play the game'); | ||
}) | ||
|
||
|