Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
03bf24d9
Commit
03bf24d9
authored
Apr 19, 2022
by
Ezekiel Kigbo
Committed by
Natalia Tepluhina
Apr 19, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add missing jest tests
Adds additional jest tests for the VSA aggregating warning message
parent
67fd98b1
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
65 additions
and
3 deletions
+65
-3
ee/app/assets/javascripts/analytics/cycle_analytics/components/value_stream_aggregating_warning.vue
...analytics/components/value_stream_aggregating_warning.vue
+1
-1
ee/app/assets/javascripts/analytics/cycle_analytics/components/value_stream_empty_state.vue
...s/cycle_analytics/components/value_stream_empty_state.vue
+1
-1
ee/spec/frontend/analytics/cycle_analytics/components/value_stream_aggregating_warning_spec.js
...ytics/components/value_stream_aggregating_warning_spec.js
+62
-0
ee/spec/frontend/analytics/cycle_analytics/components/value_stream_empty_state_spec.js
...cle_analytics/components/value_stream_empty_state_spec.js
+1
-1
No files found.
ee/app/assets/javascripts/analytics/cycle_analytics/components/value_stream_aggregating_warning.vue
View file @
03bf24d9
...
@@ -32,7 +32,7 @@ export default {
...
@@ -32,7 +32,7 @@ export default {
primaryText
:
AGGREGATING_DATA_PRIMARY_ACTION_TEXT
,
primaryText
:
AGGREGATING_DATA_PRIMARY_ACTION_TEXT
,
secondaryText
:
AGGREGATING_DATA_SECONDARY_ACTION_TEXT
,
secondaryText
:
AGGREGATING_DATA_SECONDARY_ACTION_TEXT
,
},
},
docsPath
:
helpPagePath
(
'
user/group/value_stream_analytics
'
,
{
docsPath
:
helpPagePath
(
'
user/group/value_stream_analytics
/index
'
,
{
anchor
:
'
create-a-value-stream
'
,
anchor
:
'
create-a-value-stream
'
,
}),
}),
};
};
...
...
ee/app/assets/javascripts/analytics/cycle_analytics/components/value_stream_empty_state.vue
View file @
03bf24d9
...
@@ -60,7 +60,7 @@ export default {
...
@@ -60,7 +60,7 @@ export default {
EMPTY_STATE_FILTER_ERROR_TITLE
,
EMPTY_STATE_FILTER_ERROR_TITLE
,
EMPTY_STATE_FILTER_ERROR_DESCRIPTION
,
EMPTY_STATE_FILTER_ERROR_DESCRIPTION
,
},
},
docsPath
:
helpPagePath
(
'
user/group/value_stream_analytics
'
,
{
docsPath
:
helpPagePath
(
'
user/group/value_stream_analytics
/index
'
,
{
anchor
:
'
custom-value-streams
'
,
anchor
:
'
custom-value-streams
'
,
}),
}),
};
};
...
...
ee/spec/frontend/analytics/cycle_analytics/components/value_stream_aggregating_warning_spec.js
0 → 100644
View file @
03bf24d9
import
{
shallowMount
}
from
'
@vue/test-utils
'
;
import
{
GlAlert
}
from
'
@gitlab/ui
'
;
import
ValueStreamAggregatingWarning
from
'
ee/analytics/cycle_analytics/components/value_stream_aggregating_warning.vue
'
;
import
{
extendedWrapper
}
from
'
helpers/vue_test_utils_helper
'
;
const
valueStreamTitle
=
'
New value stream
'
;
const
aggregatingMessage
=
`'
${
valueStreamTitle
}
' is collecting the data. This can take a few minutes.`
;
const
nextUpdateMsg
=
'
If you have recently upgraded to GitLab Premium, it can take up to 30 minutes for data to collect and display.
'
;
const
secondaryBtnLink
=
'
/help/user/group/value_stream_analytics/index#create-a-value-stream
'
;
const
createComponent
=
(
props
=
{})
=>
extendedWrapper
(
shallowMount
(
ValueStreamAggregatingWarning
,
{
propsData
:
{
valueStreamTitle
,
...
props
,
},
}),
);
describe
(
'
ValueStreamAggregatingWarning
'
,
()
=>
{
let
wrapper
=
null
;
const
findAlert
=
()
=>
wrapper
.
findComponent
(
GlAlert
);
const
findPrimaryButtonTxt
=
()
=>
findAlert
().
attributes
(
'
primarybuttontext
'
);
const
findSecondaryButtonTxt
=
()
=>
findAlert
().
attributes
(
'
secondarybuttontext
'
);
const
findSecondaryButtonLink
=
()
=>
findAlert
().
attributes
(
'
secondarybuttonlink
'
);
afterEach
(()
=>
{
wrapper
.
destroy
();
});
describe
(
'
default state
'
,
()
=>
{
beforeEach
(()
=>
{
wrapper
=
createComponent
();
});
it
(
'
renders the primary button
'
,
()
=>
{
expect
(
findPrimaryButtonTxt
()).
toBe
(
'
Reload page
'
);
});
it
(
'
renders the secondary button with a docs link
'
,
()
=>
{
expect
(
findSecondaryButtonTxt
()).
toBe
(
'
Learn more
'
);
expect
(
findSecondaryButtonLink
()).
toBe
(
secondaryBtnLink
);
});
it
(
'
renders the aggregating warning and estimated next update
'
,
()
=>
{
const
content
=
findAlert
().
text
();
expect
(
content
).
toContain
(
aggregatingMessage
);
expect
(
content
).
toContain
(
nextUpdateMsg
);
});
it
(
'
emits the `reload` action when the primary button is clicked
'
,
async
()
=>
{
expect
(
wrapper
.
emitted
(
'
reload
'
)).
toBeUndefined
();
await
findAlert
().
vm
.
$emit
(
'
primaryAction
'
);
expect
(
wrapper
.
emitted
(
'
reload
'
)).
toHaveLength
(
1
);
});
});
});
ee/spec/frontend/analytics/cycle_analytics/components/value_stream_empty_state_spec.js
View file @
03bf24d9
...
@@ -65,7 +65,7 @@ describe('ValueStreamEmptyState', () => {
...
@@ -65,7 +65,7 @@ describe('ValueStreamEmptyState', () => {
expect
(
findSecondaryAction
().
exists
()).
toBe
(
true
);
expect
(
findSecondaryAction
().
exists
()).
toBe
(
true
);
expect
(
findSecondaryAction
().
text
()).
toBe
(
EMPTY_STATE_SECONDARY_TEXT
);
expect
(
findSecondaryAction
().
text
()).
toBe
(
EMPTY_STATE_SECONDARY_TEXT
);
expect
(
findSecondaryAction
().
attributes
(
'
href
'
)).
toBe
(
expect
(
findSecondaryAction
().
attributes
(
'
href
'
)).
toBe
(
'
/help/user/group/value_stream_analytics#custom-value-streams
'
,
'
/help/user/group/value_stream_analytics
/index
#custom-value-streams
'
,
);
);
});
});
});
});
...
...
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