Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
logging-scratch-gui
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
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
David Goessmann
logging-scratch-gui
Commits
da66dd97
Commit
da66dd97
authored
6 years ago
by
Ben Wheeler
Browse files
Options
Downloads
Patches
Plain Diff
fixed tests
parent
49ada608
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
test/unit/reducers/alerts-reducer.test.js
+3
-2
3 additions, 2 deletions
test/unit/reducers/alerts-reducer.test.js
test/unit/util/project-saver-hoc.test.jsx
+6
-6
6 additions, 6 deletions
test/unit/util/project-saver-hoc.test.jsx
with
9 additions
and
8 deletions
test/unit/reducers/alerts-reducer.test.js
+
3
−
2
View file @
da66dd97
...
@@ -105,8 +105,9 @@ test('related alerts can clear each other', () => {
...
@@ -105,8 +105,9 @@ test('related alerts can clear each other', () => {
};
};
const
action
=
showStandardAlert
(
'
saveSuccess
'
);
const
action
=
showStandardAlert
(
'
saveSuccess
'
);
const
resultState
=
alertsReducer
(
initialState
,
action
);
const
resultState
=
alertsReducer
(
initialState
,
action
);
expect
(
resultState
.
alertsList
.
length
).
toBe
(
1
);
expect
(
resultState
.
alertsList
.
length
).
toBe
(
2
);
expect
(
resultState
.
alertsList
[
0
].
alertId
).
toBe
(
'
saveSuccess
'
);
expect
(
resultState
.
alertsList
[
0
].
alertId
).
toBe
(
'
creating
'
);
expect
(
resultState
.
alertsList
[
1
].
alertId
).
toBe
(
'
saveSuccess
'
);
});
});
test
(
'
several related alerts can be cleared at once
'
,
()
=>
{
test
(
'
several related alerts can be cleared at once
'
,
()
=>
{
...
...
This diff is collapsed.
Click to expand it.
test/unit/util/project-saver-hoc.test.jsx
+
6
−
6
View file @
da66dd97
...
@@ -178,7 +178,7 @@ describe('projectSaverHOC', () => {
...
@@ -178,7 +178,7 @@ describe('projectSaverHOC', () => {
});
});
test
(
'
if we enter remixing state, vm project should be requested, and alert should show
'
,
()
=>
{
test
(
'
if we enter remixing state, vm project should be requested, and alert should show
'
,
()
=>
{
const
mockedShowCreatingAlert
=
jest
.
fn
();
const
mockedShowCreating
Remix
Alert
=
jest
.
fn
();
const
Component
=
()
=>
<
div
/>;
const
Component
=
()
=>
<
div
/>;
const
WrappedComponent
=
projectSaverHOC
(
Component
);
const
WrappedComponent
=
projectSaverHOC
(
Component
);
const
mockedStoreProject
=
jest
.
fn
(()
=>
Promise
.
resolve
());
const
mockedStoreProject
=
jest
.
fn
(()
=>
Promise
.
resolve
());
...
@@ -197,7 +197,7 @@ describe('projectSaverHOC', () => {
...
@@ -197,7 +197,7 @@ describe('projectSaverHOC', () => {
reduxProjectId
=
{
'
100
'
}
reduxProjectId
=
{
'
100
'
}
store
=
{
store
}
store
=
{
store
}
vm
=
{
vm
}
vm
=
{
vm
}
onShowCreatingAlert
=
{
mockedShowCreatingAlert
}
onShowCreating
Remix
Alert
=
{
mockedShowCreating
Remix
Alert
}
/>
/>
);
);
mounted
.
setProps
({
mounted
.
setProps
({
...
@@ -205,11 +205,11 @@ describe('projectSaverHOC', () => {
...
@@ -205,11 +205,11 @@ describe('projectSaverHOC', () => {
loadingState
:
LoadingState
.
REMIXING
loadingState
:
LoadingState
.
REMIXING
});
});
expect
(
mockedStoreProject
).
toHaveBeenCalled
();
expect
(
mockedStoreProject
).
toHaveBeenCalled
();
expect
(
mockedShowCreatingAlert
).
toHaveBeenCalled
();
expect
(
mockedShowCreating
Remix
Alert
).
toHaveBeenCalled
();
});
});
test
(
'
if we enter creating copy state, vm project should be requested, and alert should show
'
,
()
=>
{
test
(
'
if we enter creating copy state, vm project should be requested, and alert should show
'
,
()
=>
{
const
mockedShowCreatingAlert
=
jest
.
fn
();
const
mockedShowCreating
Copy
Alert
=
jest
.
fn
();
const
Component
=
()
=>
<
div
/>;
const
Component
=
()
=>
<
div
/>;
const
WrappedComponent
=
projectSaverHOC
(
Component
);
const
WrappedComponent
=
projectSaverHOC
(
Component
);
const
mockedStoreProject
=
jest
.
fn
(()
=>
Promise
.
resolve
());
const
mockedStoreProject
=
jest
.
fn
(()
=>
Promise
.
resolve
());
...
@@ -228,7 +228,7 @@ describe('projectSaverHOC', () => {
...
@@ -228,7 +228,7 @@ describe('projectSaverHOC', () => {
reduxProjectId
=
{
'
100
'
}
reduxProjectId
=
{
'
100
'
}
store
=
{
store
}
store
=
{
store
}
vm
=
{
vm
}
vm
=
{
vm
}
onShowCreatingAlert
=
{
mockedShowCreatingAlert
}
onShowCreating
Copy
Alert
=
{
mockedShowCreating
Copy
Alert
}
/>
/>
);
);
mounted
.
setProps
({
mounted
.
setProps
({
...
@@ -236,7 +236,7 @@ describe('projectSaverHOC', () => {
...
@@ -236,7 +236,7 @@ describe('projectSaverHOC', () => {
loadingState
:
LoadingState
.
CREATING_COPY
loadingState
:
LoadingState
.
CREATING_COPY
});
});
expect
(
mockedStoreProject
).
toHaveBeenCalled
();
expect
(
mockedStoreProject
).
toHaveBeenCalled
();
expect
(
mockedShowCreatingAlert
).
toHaveBeenCalled
();
expect
(
mockedShowCreating
Copy
Alert
).
toHaveBeenCalled
();
});
});
test
(
'
if we enter updating/saving state, vm project should be requested
'
,
()
=>
{
test
(
'
if we enter updating/saving state, vm project should be requested
'
,
()
=>
{
...
...
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