Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
R
React Redux Starter Code
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
jherman5
React Redux Starter Code
Commits
e923fb05
Commit
e923fb05
authored
4 years ago
by
jherman5
Browse files
Options
Downloads
Patches
Plain Diff
fixed the test issues within app.test.
parent
95c00402
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
simon-says/src/__snapshots__/app.test.js.snap
+2
-0
2 additions, 0 deletions
simon-says/src/__snapshots__/app.test.js.snap
simon-says/src/app.test.js
+14
-9
14 additions, 9 deletions
simon-says/src/app.test.js
with
16 additions
and
9 deletions
simon-says/src/__snapshots__/app.test.js.snap
+
2
−
0
View file @
e923fb05
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`the app has four colored buttons, red, blue, yellow, and green 1`] = `<div />`;
exports[`the app has one labeled button that displays the value from the store 1`] = `
<div>
<label>
...
...
This diff is collapsed.
Click to expand it.
simon-says/src/app.test.js
+
14
−
9
View file @
e923fb05
/* eslint-disable no-magic-numbers */
import
React
from
'
react
'
;
import
{
render
}
from
'
@testing-library/react
'
;
import
'
./testing/mockRedux.js
'
;
...
...
@@ -7,16 +5,23 @@ import { MemoryRouter as Router } from 'react-router-dom';
import
{
App
}
from
'
./app.js
'
;
import
{
selectValue
,
}
from
'
./features/counter/counterSlice.js
'
;
jest
.
mock
(
'
./features/counter/counterSlice.js
'
,
()
=>
({
selectValue
:
jest
.
fn
().
mockName
(
'
selectValue
'
),
jest
.
mock
(
'
./features/patternGen/patternSlice.js
'
,
()
=>
({
selectColorOne
:
jest
.
fn
().
mockName
(
'
selectColorOne
'
),
showColorOne
:
jest
.
fn
().
mockName
(
'
showColorOne
'
),
hideColorOne
:
jest
.
fn
().
mockName
(
'
hideColorOne
'
),
selectColorTwo
:
jest
.
fn
().
mockName
(
'
selectColorTwo
'
),
showColorTwo
:
jest
.
fn
().
mockName
(
'
showColorTwo
'
),
hideColorTwo
:
jest
.
fn
().
mockName
(
'
hideColorTwo
'
),
selectColorThree
:
jest
.
fn
().
mockName
(
'
selectColorThree
'
),
showColorThree
:
jest
.
fn
().
mockName
(
'
showColorThree
'
),
hideColorThree
:
jest
.
fn
().
mockName
(
'
hideColorThree
'
),
selectColorFour
:
jest
.
fn
().
mockName
(
'
selectColorFour
'
),
showColorFour
:
jest
.
fn
().
mockName
(
'
showColorFour
'
),
hideColorFour
:
jest
.
fn
().
mockName
(
'
hideColorFour
'
),
}));
describe
(
'
the app
'
,
()
=>
{
test
(
'
has one labeled button that displays the value from the store
'
,
()
=>
{
selectValue
.
mockReturnValue
(
9999
);
test
(
'
has four colored buttons, red, blue, yellow, and green
'
,
()
=>
{
const
{
container
}
=
render
(
<
Router
initialEntries
=
{[
'
/
'
]}
>
<
App
/>
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment