Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
I
inventory-frontend
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Jira
Jira
Operations
Operations
Incidents
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
coding-brunch-hh
inventory-frontend
Commits
dd0a470a
Commit
dd0a470a
authored
Aug 09, 2018
by
Martin Fahl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
adds addDialog reducer test
parent
5bf935b0
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
193 additions
and
1 deletion
+193
-1
src/reducers/addDialog.test.js
src/reducers/addDialog.test.js
+193
-0
src/reducers/filterTerm.test.js
src/reducers/filterTerm.test.js
+0
-1
No files found.
src/reducers/addDialog.test.js
0 → 100644
View file @
dd0a470a
import
reducer
from
'
./addDialog
'
import
*
as
types
from
'
../constants/ActionTypes
'
describe
(
'
addDialog reducer
'
,
()
=>
{
it
(
'
should return the initial state
'
,
()
=>
{
expect
(
reducer
(
undefined
,
{})).
toEqual
(
{
isOpen
:
false
,
name
:
""
,
quantity
:
0
}
)
})
it
(
'
should handle OPEN_ADD_DIALOG
'
,
()
=>
{
expect
(
reducer
(
{
isOpen
:
false
,
name
:
""
,
quantity
:
0
},
{
type
:
types
.
OPEN_ADD_DIALOG
,
}
)
).
toEqual
(
{
isOpen
:
true
,
name
:
""
,
quantity
:
0
}
)
expect
(
reducer
(
{
isOpen
:
true
,
name
:
"
Test
"
,
quantity
:
2
},
{
type
:
types
.
OPEN_ADD_DIALOG
,
}
)
).
toEqual
(
{
isOpen
:
true
,
name
:
"
Test
"
,
quantity
:
2
}
)
expect
(
reducer
(
{
isOpen
:
false
,
name
:
"
Test
"
,
quantity
:
2
},
{
type
:
types
.
OPEN_ADD_DIALOG
,
}
)
).
toEqual
(
{
isOpen
:
true
,
name
:
"
Test
"
,
quantity
:
2
}
)
})
it
(
'
should handle CLOSE_ADD_DIALOG
'
,
()
=>
{
expect
(
reducer
(
{
isOpen
:
false
,
name
:
""
,
quantity
:
0
},
{
type
:
types
.
CLOSE_ADD_DIALOG
,
}
)
).
toEqual
(
{
isOpen
:
false
,
name
:
""
,
quantity
:
0
}
)
expect
(
reducer
(
{
isOpen
:
true
,
name
:
"
Test
"
,
quantity
:
2
},
{
type
:
types
.
CLOSE_ADD_DIALOG
,
}
)
).
toEqual
(
{
isOpen
:
false
,
name
:
""
,
quantity
:
0
}
)
})
it
(
'
should handle UPDATE_ADD_DIALOG_NAME
'
,
()
=>
{
expect
(
reducer
(
{
isOpen
:
true
,
name
:
""
,
quantity
:
0
},
{
type
:
types
.
UPDATE_ADD_DIALOG_NAME
,
name
:
"
Axe
"
}
)
).
toEqual
(
{
isOpen
:
true
,
name
:
"
Axe
"
,
quantity
:
0
}
)
expect
(
reducer
(
{
isOpen
:
true
,
name
:
"
Test
"
,
quantity
:
2
},
{
type
:
types
.
UPDATE_ADD_DIALOG_NAME
,
name
:
"
Axe
"
}
)
).
toEqual
(
{
isOpen
:
true
,
name
:
"
Axe
"
,
quantity
:
2
}
)
})
it
(
'
should handle UPDATE_ADD_DIALOG_QUANTITY
'
,
()
=>
{
expect
(
reducer
(
{
isOpen
:
true
,
name
:
""
,
quantity
:
0
},
{
type
:
types
.
UPDATE_ADD_DIALOG_QUANTITY
,
quantity
:
25
}
)
).
toEqual
(
{
isOpen
:
true
,
name
:
""
,
quantity
:
25
}
)
expect
(
reducer
(
{
isOpen
:
true
,
name
:
"
Test
"
,
quantity
:
2
},
{
type
:
types
.
UPDATE_ADD_DIALOG_QUANTITY
,
quantity
:
27
}
)
).
toEqual
(
{
isOpen
:
true
,
name
:
"
Test
"
,
quantity
:
27
}
)
})
})
\ No newline at end of file
src/reducers/filterTerm.test.js
View file @
dd0a470a
import
reducer
from
'
./filterTerm
'
import
*
as
actions
from
'
../actions
'
import
*
as
types
from
'
../constants/ActionTypes
'
describe
(
'
filterTerm reducer
'
,
()
=>
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment