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
b3a9c3af
Commit
b3a9c3af
authored
Jul 06, 2021
by
Brandon Labuschagne
Committed by
Phil Hughes
Jul 06, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
DevOps Adoption - Remove remaining references to segments
parent
b79e6c98
Changes
17
Hide whitespace changes
Inline
Side-by-side
Showing
17 changed files
with
129 additions
and
130 deletions
+129
-130
ee/app/assets/javascripts/analytics/devops_report/devops_adoption/components/devops_adoption_add_dropdown.vue
...vops_adoption/components/devops_adoption_add_dropdown.vue
+1
-1
ee/app/assets/javascripts/analytics/devops_report/devops_adoption/components/devops_adoption_app.vue
...report/devops_adoption/components/devops_adoption_app.vue
+23
-20
ee/app/assets/javascripts/analytics/devops_report/devops_adoption/components/devops_adoption_delete_modal.vue
...vops_adoption/components/devops_adoption_delete_modal.vue
+9
-9
ee/app/assets/javascripts/analytics/devops_report/devops_adoption/components/devops_adoption_section.vue
...rt/devops_adoption/components/devops_adoption_section.vue
+6
-6
ee/app/assets/javascripts/analytics/devops_report/devops_adoption/components/devops_adoption_table.vue
...port/devops_adoption/components/devops_adoption_table.vue
+17
-17
ee/app/assets/javascripts/analytics/devops_report/devops_adoption/constants.js
...ipts/analytics/devops_report/devops_adoption/constants.js
+8
-10
ee/app/assets/javascripts/analytics/devops_report/devops_adoption/utils/cache_updates.js
...tics/devops_report/devops_adoption/utils/cache_updates.js
+4
-4
ee/app/assets/javascripts/analytics/devops_report/devops_adoption/utils/helpers.js
.../analytics/devops_report/devops_adoption/utils/helpers.js
+8
-6
ee/spec/frontend/analytics/devops_report/devops_adoption/components/devops_adoption_add_dropdown_spec.js
..._adoption/components/devops_adoption_add_dropdown_spec.js
+4
-4
ee/spec/frontend/analytics/devops_report/devops_adoption/components/devops_adoption_app_spec.js
...rt/devops_adoption/components/devops_adoption_app_spec.js
+7
-7
ee/spec/frontend/analytics/devops_report/devops_adoption/components/devops_adoption_delete_modal_spec.js
..._adoption/components/devops_adoption_delete_modal_spec.js
+10
-11
ee/spec/frontend/analytics/devops_report/devops_adoption/components/devops_adoption_empty_state_spec.js
...s_adoption/components/devops_adoption_empty_state_spec.js
+0
-1
ee/spec/frontend/analytics/devops_report/devops_adoption/components/devops_adoption_section_spec.js
...evops_adoption/components/devops_adoption_section_spec.js
+5
-5
ee/spec/frontend/analytics/devops_report/devops_adoption/components/devops_adoption_table_spec.js
.../devops_adoption/components/devops_adoption_table_spec.js
+11
-11
ee/spec/frontend/analytics/devops_report/devops_adoption/mock_data.js
...tend/analytics/devops_report/devops_adoption/mock_data.js
+0
-2
ee/spec/frontend/analytics/devops_report/devops_adoption/utils/cache_updates_spec.js
...devops_report/devops_adoption/utils/cache_updates_spec.js
+6
-6
ee/spec/frontend/analytics/devops_report/devops_adoption/utils/helpers_spec.js
...ytics/devops_report/devops_adoption/utils/helpers_spec.js
+10
-10
No files found.
ee/app/assets/javascripts/analytics/devops_report/devops_adoption/components/devops_adoption_add_dropdown.vue
View file @
b3a9c3af
...
...
@@ -100,7 +100,7 @@ export default {
bulkEnableDevopsAdoptionNamespaces
:
{
enabledNamespaces
,
errors
:
requestErrors
},
}
=
data
;
if
(
!
requestErrors
.
length
)
this
.
$emit
(
'
segment
sAdded
'
,
enabledNamespaces
);
if
(
!
requestErrors
.
length
)
this
.
$emit
(
'
enabledNamespace
sAdded
'
,
enabledNamespaces
);
},
})
.
catch
((
error
)
=>
{
...
...
ee/app/assets/javascripts/analytics/devops_report/devops_adoption/components/devops_adoption_app.vue
View file @
b3a9c3af
...
...
@@ -19,7 +19,10 @@ import {
import
bulkEnableDevopsAdoptionNamespacesMutation
from
'
../graphql/mutations/bulk_enable_devops_adoption_namespaces.mutation.graphql
'
;
import
devopsAdoptionEnabledNamespacesQuery
from
'
../graphql/queries/devops_adoption_enabled_namespaces.query.graphql
'
;
import
getGroupsQuery
from
'
../graphql/queries/get_groups.query.graphql
'
;
import
{
addSegmentsToCache
,
deleteSegmentsFromCache
}
from
'
../utils/cache_updates
'
;
import
{
addEnabledNamespacesToCache
,
deleteEnabledNamespacesFromCache
,
}
from
'
../utils/cache_updates
'
;
import
{
shouldPollTableData
}
from
'
../utils/helpers
'
;
import
DevopsAdoptionAddDropdown
from
'
./devops_adoption_add_dropdown.vue
'
;
import
DevopsAdoptionOverview
from
'
./devops_adoption_overview.vue
'
;
...
...
@@ -69,15 +72,15 @@ export default {
openModal
:
false
,
errors
:
{
[
DEVOPS_ADOPTION_ERROR_KEYS
.
groups
]:
false
,
[
DEVOPS_ADOPTION_ERROR_KEYS
.
segment
s
]:
false
,
[
DEVOPS_ADOPTION_ERROR_KEYS
.
add
Segment
]:
false
,
[
DEVOPS_ADOPTION_ERROR_KEYS
.
enabledNamespace
s
]:
false
,
[
DEVOPS_ADOPTION_ERROR_KEYS
.
add
EnabledNamespaces
]:
false
,
},
groups
:
{
nodes
:
[],
pageInfo
:
null
,
},
pollingTableData
:
null
,
segments
QueryVariables
:
{
enabledNamespace
QueryVariables
:
{
displayNamespaceId
:
this
.
isGroup
?
this
.
groupGid
:
null
,
},
adoptionTabClicked
:
false
,
...
...
@@ -92,7 +95,7 @@ export default {
isSingleRequest
:
true
,
},
variables
()
{
return
this
.
segments
QueryVariables
;
return
this
.
enabledNamespace
QueryVariables
;
},
result
({
data
})
{
if
(
this
.
isGroup
)
{
...
...
@@ -106,7 +109,7 @@ export default {
}
},
error
(
error
)
{
this
.
handleError
(
DEVOPS_ADOPTION_ERROR_KEYS
.
segment
s
,
error
);
this
.
handleError
(
DEVOPS_ADOPTION_ERROR_KEYS
.
enabledNamespace
s
,
error
);
},
},
},
...
...
@@ -117,7 +120,7 @@ export default {
hasGroupData
()
{
return
Boolean
(
this
.
groups
?.
nodes
?.
length
);
},
has
Segments
Data
()
{
has
EnabledNamespace
Data
()
{
return
Boolean
(
this
.
devopsAdoptionEnabledNamespaces
?.
nodes
?.
length
);
},
hasLoadingError
()
{
...
...
@@ -191,14 +194,14 @@ export default {
}
=
data
;
if
(
errors
.
length
)
{
this
.
handleError
(
DEVOPS_ADOPTION_ERROR_KEYS
.
add
Segment
,
errors
);
this
.
handleError
(
DEVOPS_ADOPTION_ERROR_KEYS
.
add
EnabledNamespaces
,
errors
);
}
else
{
this
.
add
Segment
sToCache
(
enabledNamespaces
);
this
.
add
EnabledNamespace
sToCache
(
enabledNamespaces
);
}
},
})
.
catch
((
error
)
=>
{
this
.
handleError
(
DEVOPS_ADOPTION_ERROR_KEYS
.
add
Segment
,
error
);
this
.
handleError
(
DEVOPS_ADOPTION_ERROR_KEYS
.
add
EnabledNamespaces
,
error
);
})
.
finally
(()
=>
{
this
.
isLoadingEnableGroup
=
false
;
...
...
@@ -206,7 +209,7 @@ export default {
},
pollTableData
()
{
const
shouldPoll
=
shouldPollTableData
({
segment
s
:
this
.
devopsAdoptionEnabledNamespaces
.
nodes
,
enabledNamespace
s
:
this
.
devopsAdoptionEnabledNamespaces
.
nodes
,
timestamp
:
this
.
devopsAdoptionEnabledNamespaces
?.
nodes
[
0
]?.
latestSnapshot
?.
recordedAt
,
openModal
:
this
.
openModal
,
});
...
...
@@ -250,15 +253,15 @@ export default {
})
.
catch
((
error
)
=>
this
.
handleError
(
DEVOPS_ADOPTION_ERROR_KEYS
.
groups
,
error
));
},
add
SegmentsToCache
(
segment
s
)
{
add
EnabledNamespacesToCache
(
enabledNamespace
s
)
{
const
{
cache
}
=
this
.
$apollo
.
getClient
();
add
SegmentsToCache
(
cache
,
segments
,
this
.
segments
QueryVariables
);
add
EnabledNamespacesToCache
(
cache
,
enabledNamespaces
,
this
.
enabledNamespace
QueryVariables
);
},
delete
Segment
sFromCache
(
ids
)
{
delete
EnabledNamespace
sFromCache
(
ids
)
{
const
{
cache
}
=
this
.
$apollo
.
getClient
();
delete
SegmentsFromCache
(
cache
,
ids
,
this
.
segments
QueryVariables
);
delete
EnabledNamespacesFromCache
(
cache
,
ids
,
this
.
enabledNamespace
QueryVariables
);
},
selectTab
()
{
const
[
value
]
=
getParameterValues
(
'
tab
'
);
...
...
@@ -327,18 +330,18 @@ export default {
<devops-adoption-section
v-else
:is-loading=
"isLoadingAdoptionData"
:has-
segments-data=
"hasSegments
Data"
:has-
enabled-namespace-data=
"hasEnabledNamespace
Data"
:timestamp=
"timestamp"
:has-group-data=
"hasGroupData"
:cols=
"tab.cols"
:
segment
s=
"devopsAdoptionEnabledNamespaces"
:
enabled-namespace
s=
"devopsAdoptionEnabledNamespaces"
:search-term=
"searchTerm"
:disabled-group-nodes=
"disabledGroupNodes"
:is-loading-groups=
"isLoadingGroups"
:has-subgroups=
"hasSubgroups"
@
segmentsRemoved=
"deleteSegment
sFromCache"
@
enabledNamespacesRemoved=
"deleteEnabledNamespace
sFromCache"
@
fetchGroups=
"fetchGroups"
@
segmentsAdded=
"addSegment
sToCache"
@
enabledNamespacesAdded=
"addEnabledNamespace
sToCache"
@
trackModalOpenState=
"trackModalOpenState"
/>
</gl-tab>
...
...
@@ -359,7 +362,7 @@ export default {
:is-loading-groups=
"isLoadingGroups"
:has-subgroups=
"hasSubgroups"
@
fetchGroups=
"fetchGroups"
@
segmentsAdded=
"addSegment
sToCache"
@
enabledNamespacesAdded=
"addEnabledNamespace
sToCache"
/>
</span>
</
template
>
...
...
ee/app/assets/javascripts/analytics/devops_report/devops_adoption/components/devops_adoption_delete_modal.vue
View file @
b3a9c3af
<
script
>
import
{
GlModal
,
GlSprintf
,
GlAlert
}
from
'
@gitlab/ui
'
;
import
*
as
Sentry
from
'
@sentry/browser
'
;
import
{
DEVOPS_ADOPTION_STRINGS
,
DEVOPS_ADOPTION_
SEGMENT_
DELETE_MODAL_ID
}
from
'
../constants
'
;
import
{
DEVOPS_ADOPTION_STRINGS
,
DEVOPS_ADOPTION_DELETE_MODAL_ID
}
from
'
../constants
'
;
import
disableDevopsAdoptionNamespaceMutation
from
'
../graphql/mutations/disable_devops_adoption_namespace.mutation.graphql
'
;
export
default
{
name
:
'
DevopsAdoptionDeleteModal
'
,
components
:
{
GlModal
,
GlSprintf
,
GlAlert
},
i18n
:
DEVOPS_ADOPTION_STRINGS
.
deleteModal
,
de
vopsSegmentDeleteModalId
:
DEVOPS_ADOPTION_SEGMENT
_DELETE_MODAL_ID
,
de
leteModalId
:
DEVOPS_ADOPTION
_DELETE_MODAL_ID
,
props
:
{
segment
:
{
namespace
:
{
type
:
Object
,
required
:
true
,
},
...
...
@@ -43,14 +43,14 @@ export default {
return
this
.
errors
[
0
];
},
displayName
()
{
return
this
.
segment
.
namespace
?.
fullName
;
return
this
.
namespace
.
namespace
?.
fullName
;
},
},
methods
:
{
async
delete
Segment
()
{
async
delete
EnabledNamespace
()
{
try
{
const
{
segment
:
{
id
},
namespace
:
{
id
},
}
=
this
;
this
.
loading
=
true
;
...
...
@@ -65,7 +65,7 @@ export default {
id
:
[
id
],
},
update
:
()
=>
{
this
.
$emit
(
'
segment
sRemoved
'
,
[
id
]);
this
.
$emit
(
'
enabledNamespace
sRemoved
'
,
[
id
]);
},
});
...
...
@@ -90,11 +90,11 @@ export default {
<
template
>
<gl-modal
ref=
"modal"
:modal-id=
"$options.de
vopsSegmentDe
leteModalId"
:modal-id=
"$options.deleteModalId"
size=
"sm"
:action-primary=
"primaryOptions"
:action-cancel=
"cancelOptions"
@
primary.prevent=
"delete
Segment
"
@
primary.prevent=
"delete
EnabledNamespace
"
@
hide=
"$emit('trackModalOpenState', false)"
@
show=
"$emit('trackModalOpenState', true)"
>
...
...
ee/app/assets/javascripts/analytics/devops_report/devops_adoption/components/devops_adoption_section.vue
View file @
b3a9c3af
...
...
@@ -21,7 +21,7 @@ export default {
type
:
Boolean
,
required
:
true
,
},
has
Segments
Data
:
{
has
EnabledNamespace
Data
:
{
type
:
Boolean
,
required
:
true
,
},
...
...
@@ -37,7 +37,7 @@ export default {
type
:
Array
,
required
:
true
,
},
segment
s
:
{
enabledNamespace
s
:
{
type
:
Object
,
required
:
false
,
default
:
()
=>
{},
...
...
@@ -64,7 +64,7 @@ export default {
</
script
>
<
template
>
<gl-loading-icon
v-if=
"isLoading"
size=
"md"
class=
"gl-my-5"
/>
<div
v-else-if=
"has
Segments
Data"
class=
"gl-mt-3"
>
<div
v-else-if=
"has
EnabledNamespace
Data"
class=
"gl-mt-3"
>
<div
class=
"gl-mb-3"
data-testid=
"tableHeader"
>
<p
class=
"gl-text-gray-400"
>
<gl-sprintf
:message=
"$options.i18n.tableHeaderText"
>
...
...
@@ -79,14 +79,14 @@ export default {
:is-loading-groups=
"isLoadingGroups"
:has-subgroups=
"hasSubgroups"
@
fetchGroups=
"$emit('fetchGroups', $event)"
@
segmentsAdded=
"$emit('segment
sAdded', $event)"
@
enabledNamespacesAdded=
"$emit('enabledNamespace
sAdded', $event)"
@
trackModalOpenState=
"$emit('trackModalOpenState', $event)"
/>
</div>
<devops-adoption-table
:cols=
"cols"
:
segments=
"segment
s.nodes"
@
segmentsRemoved=
"$emit('segment
sRemoved', $event)"
:
enabled-namespaces=
"enabledNamespace
s.nodes"
@
enabledNamespacesRemoved=
"$emit('enabledNamespace
sRemoved', $event)"
@
trackModalOpenState=
"$emit('trackModalOpenState', $event)"
/>
</div>
...
...
ee/app/assets/javascripts/analytics/devops_report/devops_adoption/components/devops_adoption_table.vue
View file @
b3a9c3af
...
...
@@ -11,9 +11,9 @@ import LocalStorageSync from '~/vue_shared/components/local_storage_sync.vue';
import
{
DEVOPS_ADOPTION_TABLE_TEST_IDS
,
DEVOPS_ADOPTION_STRINGS
,
DEVOPS_ADOPTION_
SEGMENT_
DELETE_MODAL_ID
,
DEVOPS_ADOPTION_
SEGMENTS_
TABLE_SORT_BY_STORAGE_KEY
,
DEVOPS_ADOPTION_
SEGMENTS_
TABLE_SORT_DESC_STORAGE_KEY
,
DEVOPS_ADOPTION_DELETE_MODAL_ID
,
DEVOPS_ADOPTION_TABLE_SORT_BY_STORAGE_KEY
,
DEVOPS_ADOPTION_TABLE_SORT_DESC_STORAGE_KEY
,
DEVOPS_ADOPTION_TABLE_REMOVE_BUTTON_DISABLED
,
DEVOPS_ADOPTION_GROUP_COL_LABEL
,
}
from
'
../constants
'
;
...
...
@@ -70,12 +70,12 @@ export default {
...
i18n
,
removeButtonDisabled
:
DEVOPS_ADOPTION_TABLE_REMOVE_BUTTON_DISABLED
,
},
de
vopsSegmentDeleteModalId
:
DEVOPS_ADOPTION_SEGMENT
_DELETE_MODAL_ID
,
de
leteModalId
:
DEVOPS_ADOPTION
_DELETE_MODAL_ID
,
testids
:
DEVOPS_ADOPTION_TABLE_TEST_IDS
,
sortByStorageKey
:
DEVOPS_ADOPTION_
SEGMENTS_
TABLE_SORT_BY_STORAGE_KEY
,
sortDescStorageKey
:
DEVOPS_ADOPTION_
SEGMENTS_
TABLE_SORT_DESC_STORAGE_KEY
,
sortByStorageKey
:
DEVOPS_ADOPTION_TABLE_SORT_BY_STORAGE_KEY
,
sortDescStorageKey
:
DEVOPS_ADOPTION_TABLE_SORT_DESC_STORAGE_KEY
,
props
:
{
segment
s
:
{
enabledNamespace
s
:
{
type
:
Array
,
required
:
true
,
},
...
...
@@ -88,7 +88,7 @@ export default {
return
{
sortBy
:
NAME_HEADER
,
sortDesc
:
false
,
selected
Segment
:
null
,
selected
Namespace
:
null
,
};
},
computed
:
{
...
...
@@ -113,8 +113,8 @@ export default {
},
},
methods
:
{
setSelected
Segment
(
segment
)
{
this
.
selected
Segment
=
segment
;
setSelected
Namespace
(
namespace
)
{
this
.
selected
Namespace
=
namespace
;
},
headerSlotName
(
key
)
{
return
`head(
${
key
}
)`
;
...
...
@@ -149,7 +149,7 @@ export default {
/>
<gl-table
:fields=
"tableHeaderFields"
:items=
"
segment
s"
:items=
"
enabledNamespace
s"
:sort-by.sync=
"sortBy"
:sort-desc.sync=
"sortDesc"
thead-class=
"gl-border-t-0 gl-border-b-solid gl-border-b-1 gl-border-b-gray-100"
...
...
@@ -169,7 +169,7 @@ export default {
</
template
>
<
template
#cell(name)=
"{ item }"
>
<div
:data-testid=
"$options.testids.
SEGMENT
"
>
<div
:data-testid=
"$options.testids.
NAMESPACE
"
>
<strong
v-if=
"item.latestSnapshot"
>
{{
item
.
namespace
.
fullName
}}
</strong>
<template
v-else
>
<span
class=
"gl-text-gray-400"
>
{{
item
.
namespace
.
fullName
}}
</span>
...
...
@@ -196,20 +196,20 @@ export default {
:data-testid=
"$options.testids.ACTIONS"
>
<gl-button
v-gl-modal=
"$options.de
vopsSegmentDe
leteModalId"
v-gl-modal=
"$options.deleteModalId"
:disabled=
"isCurrentGroup(item)"
category=
"tertiary"
icon=
"remove"
:aria-label=
"$options.i18n.removeButton"
@
click=
"setSelected
Segment
(item)"
@
click=
"setSelected
Namespace
(item)"
/>
</span>
</
template
>
</gl-table>
<devops-adoption-delete-modal
v-if=
"selected
Segment
"
:
segment=
"selectedSegment
"
@
segmentsRemoved=
"$emit('segment
sRemoved', $event)"
v-if=
"selected
Namespace
"
:
namespace=
"selectedNamespace
"
@
enabledNamespacesRemoved=
"$emit('enabledNamespace
sRemoved', $event)"
@
trackModalOpenState=
"$emit('trackModalOpenState', $event)"
/>
</div>
...
...
ee/app/assets/javascripts/analytics/devops_report/devops_adoption/constants.js
View file @
b3a9c3af
...
...
@@ -8,14 +8,14 @@ export const DEBOUNCE_DELAY = 500;
export
const
DEVOPS_ADOPTION_PROGRESS_BAR_HEIGHT
=
'
8px
'
;
export
const
DEVOPS_ADOPTION_
SEGMENT_DELETE_MODAL_ID
=
'
devopsSegment
DeleteModal
'
;
export
const
DEVOPS_ADOPTION_
DELETE_MODAL_ID
=
'
devops
DeleteModal
'
;
export
const
DATE_TIME_FORMAT
=
'
yyyy-mm-dd HH:MM
'
;
export
const
DEVOPS_ADOPTION_ERROR_KEYS
=
{
groups
:
'
groupsError
'
,
segments
:
'
segment
sError
'
,
add
Segment
:
'
addSegment
sError
'
,
enabledNamespaces
:
'
enabledNamespace
sError
'
,
add
EnabledNamespaces
:
'
addEnabledNamespace
sError
'
,
};
export
const
TABLE_HEADER_TEXT
=
s__
(
...
...
@@ -46,10 +46,10 @@ export const DEVOPS_ADOPTION_STRINGS = {
[
DEVOPS_ADOPTION_ERROR_KEYS
.
groups
]:
s__
(
'
DevopsAdoption|There was an error fetching Groups. Please refresh the page.
'
,
),
[
DEVOPS_ADOPTION_ERROR_KEYS
.
segment
s
]:
s__
(
[
DEVOPS_ADOPTION_ERROR_KEYS
.
enabledNamespace
s
]:
s__
(
'
DevopsAdoption|There was an error fetching Group adoption data. Please refresh the page.
'
,
),
[
DEVOPS_ADOPTION_ERROR_KEYS
.
add
Segment
]:
s__
(
[
DEVOPS_ADOPTION_ERROR_KEYS
.
add
EnabledNamespaces
]:
s__
(
'
DevopsAdoption|There was an error enabling the current group. Please refresh the page.
'
,
),
tableHeader
:
{
...
...
@@ -92,17 +92,15 @@ export const DEVOPS_ADOPTION_STRINGS = {
export
const
DEVOPS_ADOPTION_TABLE_TEST_IDS
=
{
TABLE_HEADERS
:
'
header
'
,
SEGMENT
:
'
segment
Col
'
,
NAMESPACE
:
'
namespace
Col
'
,
ACTIONS
:
'
actionsCol
'
,
LOCAL_STORAGE_SORT_BY
:
'
localStorageSortBy
'
,
LOCAL_STORAGE_SORT_DESC
:
'
localStorageSortDesc
'
,
};
export
const
DEVOPS_ADOPTION_SEGMENTS_TABLE_SORT_BY_STORAGE_KEY
=
'
devops_adoption_segments_table_sort_by
'
;
export
const
DEVOPS_ADOPTION_TABLE_SORT_BY_STORAGE_KEY
=
'
devops_adoption_table_sort_by
'
;
export
const
DEVOPS_ADOPTION_SEGMENTS_TABLE_SORT_DESC_STORAGE_KEY
=
'
devops_adoption_segments_table_sort_desc
'
;
export
const
DEVOPS_ADOPTION_TABLE_SORT_DESC_STORAGE_KEY
=
'
devops_adoption_table_sort_desc
'
;
export
const
DEVOPS_ADOPTION_GROUP_COL_LABEL
=
__
(
'
Group
'
);
...
...
ee/app/assets/javascripts/analytics/devops_report/devops_adoption/utils/cache_updates.js
View file @
b3a9c3af
import
produce
from
'
immer
'
;
import
devopsAdoptionEnabledNamespacesQuery
from
'
../graphql/queries/devops_adoption_enabled_namespaces.query.graphql
'
;
export
const
add
SegmentsToCache
=
(
store
,
segment
s
,
variables
)
=>
{
export
const
add
EnabledNamespacesToCache
=
(
store
,
enabledNamespace
s
,
variables
)
=>
{
const
sourceData
=
store
.
readQuery
({
query
:
devopsAdoptionEnabledNamespacesQuery
,
variables
,
...
...
@@ -10,7 +10,7 @@ export const addSegmentsToCache = (store, segments, variables) => {
const
data
=
produce
(
sourceData
,
(
draftData
)
=>
{
draftData
.
devopsAdoptionEnabledNamespaces
.
nodes
=
[
...
draftData
.
devopsAdoptionEnabledNamespaces
.
nodes
,
...
segment
s
,
...
enabledNamespace
s
,
];
});
...
...
@@ -21,7 +21,7 @@ export const addSegmentsToCache = (store, segments, variables) => {
});
};
export
const
delete
SegmentsFromCache
=
(
store
,
segment
Ids
,
variables
)
=>
{
export
const
delete
EnabledNamespacesFromCache
=
(
store
,
enabledNamespace
Ids
,
variables
)
=>
{
const
sourceData
=
store
.
readQuery
({
query
:
devopsAdoptionEnabledNamespacesQuery
,
variables
,
...
...
@@ -29,7 +29,7 @@ export const deleteSegmentsFromCache = (store, segmentIds, variables) => {
const
updatedData
=
produce
(
sourceData
,
(
draftData
)
=>
{
draftData
.
devopsAdoptionEnabledNamespaces
.
nodes
=
draftData
.
devopsAdoptionEnabledNamespaces
.
nodes
.
filter
(
({
id
})
=>
!
segment
Ids
.
includes
(
id
),
({
id
})
=>
!
enabledNamespace
Ids
.
includes
(
id
),
);
});
...
...
ee/app/assets/javascripts/analytics/devops_report/devops_adoption/utils/helpers.js
View file @
b3a9c3af
import
{
isToday
}
from
'
~/lib/utils/datetime_utility
'
;
/**
* A helper function which accepts the
segment
s,
* A helper function which accepts the
enabledNamespace
s,
*
* @param {Object} params the
segment
data, timestamp and check for open modals
* @param {Object} params the
enabledNamespaces
data, timestamp and check for open modals
*
* @return {Boolean} a boolean to determine if table data should be polled
*/
export
const
shouldPollTableData
=
({
segment
s
,
timestamp
,
openModal
})
=>
{
export
const
shouldPollTableData
=
({
enabledNamespace
s
,
timestamp
,
openModal
})
=>
{
if
(
openModal
)
{
return
false
;
}
else
if
(
!
segment
s
.
length
)
{
}
else
if
(
!
enabledNamespace
s
.
length
)
{
return
true
;
}
const
anyPendingSegments
=
segments
.
some
((
node
)
=>
node
.
latestSnapshot
===
null
);
const
anyPendingEnabledNamespaces
=
enabledNamespaces
.
some
(
(
node
)
=>
node
.
latestSnapshot
===
null
,
);
const
dataNotRefreshedToday
=
!
isToday
(
new
Date
(
timestamp
));
return
anyPending
Segment
s
||
dataNotRefreshedToday
;
return
anyPending
EnabledNamespace
s
||
dataNotRefreshedToday
;
};
ee/spec/frontend/analytics/devops_report/devops_adoption/components/devops_adoption_add_dropdown_spec.js
View file @
b3a9c3af
...
...
@@ -149,8 +149,8 @@ describe('DevopsAdoptionAddDropdown', () => {
});
});
it
(
'
emits the
segment
sAdded event
'
,
()
=>
{
const
[
params
]
=
wrapper
.
emitted
().
segment
sAdded
[
0
];
it
(
'
emits the
enabledNamespace
sAdded event
'
,
()
=>
{
const
[
params
]
=
wrapper
.
emitted
().
enabledNamespace
sAdded
[
0
];
expect
(
params
).
toStrictEqual
([
devopsAdoptionNamespaceData
.
nodes
[
0
]]);
});
...
...
@@ -174,8 +174,8 @@ describe('DevopsAdoptionAddDropdown', () => {
);
});
it
(
'
does not emit the
segment
sAdded event
'
,
()
=>
{
expect
(
wrapper
.
emitted
().
segment
sAdded
).
not
.
toBeDefined
();
it
(
'
does not emit the
enabledNamespace
sAdded event
'
,
()
=>
{
expect
(
wrapper
.
emitted
().
enabledNamespace
sAdded
).
not
.
toBeDefined
();
});
});
});
...
...
ee/spec/frontend/analytics/devops_report/devops_adoption/components/devops_adoption_app_spec.js
View file @
b3a9c3af
...
...
@@ -15,7 +15,7 @@ import {
import
bulkEnableDevopsAdoptionNamespacesMutation
from
'
ee/analytics/devops_report/devops_adoption/graphql/mutations/bulk_enable_devops_adoption_namespaces.mutation.graphql
'
;
import
devopsAdoptionEnabledNamespaces
from
'
ee/analytics/devops_report/devops_adoption/graphql/queries/devops_adoption_enabled_namespaces.query.graphql
'
;
import
getGroupsQuery
from
'
ee/analytics/devops_report/devops_adoption/graphql/queries/get_groups.query.graphql
'
;
import
{
add
Segment
sToCache
}
from
'
ee/analytics/devops_report/devops_adoption/utils/cache_updates
'
;
import
{
add
EnabledNamespace
sToCache
}
from
'
ee/analytics/devops_report/devops_adoption/utils/cache_updates
'
;
import
createMockApollo
from
'
helpers/mock_apollo_helper
'
;
import
{
shallowMountExtended
}
from
'
helpers/vue_test_utils_helper
'
;
import
waitForPromises
from
'
helpers/wait_for_promises
'
;
...
...
@@ -24,7 +24,7 @@ import API from '~/api';
import
{
groupNodes
,
devopsAdoptionNamespaceData
}
from
'
../mock_data
'
;
jest
.
mock
(
'
ee/analytics/devops_report/devops_adoption/utils/cache_updates
'
,
()
=>
({
add
Segment
sToCache
:
jest
.
fn
(),
add
EnabledNamespace
sToCache
:
jest
.
fn
(),
}));
const
localVue
=
createLocalVue
();
...
...
@@ -234,9 +234,9 @@ describe('DevopsAdoptionApp', () => {
);
});
it
(
'
calls add
Segment
sToCache with the correct variables
'
,
()
=>
{
expect
(
add
Segment
sToCache
).
toHaveBeenCalledTimes
(
1
);
expect
(
add
Segment
sToCache
).
toHaveBeenCalledWith
(
it
(
'
calls add
EnabledNamespace
sToCache with the correct variables
'
,
()
=>
{
expect
(
add
EnabledNamespace
sToCache
).
toHaveBeenCalledTimes
(
1
);
expect
(
add
EnabledNamespace
sToCache
).
toHaveBeenCalledWith
(
expect
.
anything
(),
[
devopsAdoptionNamespaceData
.
nodes
[
0
]],
{
...
...
@@ -270,7 +270,7 @@ describe('DevopsAdoptionApp', () => {
it
(
'
displays the error message
'
,
()
=>
{
const
alert
=
wrapper
.
findComponent
(
GlAlert
);
expect
(
alert
.
exists
()).
toBe
(
true
);
expect
(
alert
.
text
()).
toBe
(
DEVOPS_ADOPTION_STRINGS
.
app
.
add
Segment
sError
);
expect
(
alert
.
text
()).
toBe
(
DEVOPS_ADOPTION_STRINGS
.
app
.
add
EnabledNamespace
sError
);
});
it
(
'
calls Sentry
'
,
()
=>
{
...
...
@@ -301,7 +301,7 @@ describe('DevopsAdoptionApp', () => {
it
(
'
displays the error message
'
,
()
=>
{
const
alert
=
wrapper
.
findComponent
(
GlAlert
);
expect
(
alert
.
exists
()).
toBe
(
true
);
expect
(
alert
.
text
()).
toBe
(
DEVOPS_ADOPTION_STRINGS
.
app
.
segment
sError
);
expect
(
alert
.
text
()).
toBe
(
DEVOPS_ADOPTION_STRINGS
.
app
.
enabledNamespace
sError
);
});
it
(
'
calls Sentry
'
,
()
=>
{
...
...
ee/spec/frontend/analytics/devops_report/devops_adoption/components/devops_adoption_delete_modal_spec.js
View file @
b3a9c3af
...
...
@@ -4,7 +4,7 @@ import { createLocalVue, shallowMount } from '@vue/test-utils';
import
Vue
from
'
vue
'
;
import
VueApollo
from
'
vue-apollo
'
;
import
DevopsAdoptionDeleteModal
from
'
ee/analytics/devops_report/devops_adoption/components/devops_adoption_delete_modal.vue
'
;
import
{
DEVOPS_ADOPTION_
SEGMENT_
DELETE_MODAL_ID
}
from
'
ee/analytics/devops_report/devops_adoption/constants
'
;
import
{
DEVOPS_ADOPTION_DELETE_MODAL_ID
}
from
'
ee/analytics/devops_report/devops_adoption/constants
'
;
import
disableDevopsAdoptionNamespaceMutation
from
'
ee/analytics/devops_report/devops_adoption/graphql/mutations/disable_devops_adoption_namespace.mutation.graphql
'
;
import
createMockApollo
from
'
helpers/mock_apollo_helper
'
;
import
waitForPromises
from
'
helpers/wait_for_promises
'
;
...
...
@@ -38,16 +38,16 @@ const mutateWithErrors = jest.fn().mockRejectedValue(genericDeleteErrorMessage);
describe
(
'
DevopsAdoptionDeleteModal
'
,
()
=>
{
let
wrapper
;
const
createComponent
=
({
delete
Segment
sSpy
=
mutate
,
props
=
{}
}
=
{})
=>
{
const
createComponent
=
({
delete
EnabledNamespace
sSpy
=
mutate
,
props
=
{}
}
=
{})
=>
{
const
mockApollo
=
createMockApollo
([
[
disableDevopsAdoptionNamespaceMutation
,
delete
Segment
sSpy
],
[
disableDevopsAdoptionNamespaceMutation
,
delete
EnabledNamespace
sSpy
],
]);
wrapper
=
shallowMount
(
DevopsAdoptionDeleteModal
,
{
localVue
,
apolloProvider
:
mockApollo
,
propsData
:
{
segment
:
devopsAdoptionNamespaceData
.
nodes
[
0
],
namespace
:
devopsAdoptionNamespaceData
.
nodes
[
0
],
...
props
,
},
stubs
:
{
...
...
@@ -63,7 +63,6 @@ describe('DevopsAdoptionDeleteModal', () => {
afterEach
(()
=>
{
wrapper
.
destroy
();
wrapper
=
null
;
});
describe
(
'
default display
'
,
()
=>
{
...
...
@@ -73,7 +72,7 @@ describe('DevopsAdoptionDeleteModal', () => {
const
modal
=
findModal
();
expect
(
modal
.
exists
()).
toBe
(
true
);
expect
(
modal
.
props
(
'
modalId
'
)).
toBe
(
DEVOPS_ADOPTION_
SEGMENT_
DELETE_MODAL_ID
);
expect
(
modal
.
props
(
'
modalId
'
)).
toBe
(
DEVOPS_ADOPTION_DELETE_MODAL_ID
);
});
it
(
'
displays the confirmation message
'
,
()
=>
{
...
...
@@ -104,7 +103,7 @@ describe('DevopsAdoptionDeleteModal', () => {
describe
(
'
submitting the form
'
,
()
=>
{
describe
(
'
while waiting for the mutation
'
,
()
=>
{
beforeEach
(()
=>
createComponent
({
delete
Segment
sSpy
:
mutateLoading
}));
beforeEach
(()
=>
createComponent
({
delete
EnabledNamespace
sSpy
:
mutateLoading
}));
it
(
'
disables the cancel button
'
,
async
()
=>
{
expect
(
cancelButtonDisabledState
()).
toBe
(
false
);
...
...
@@ -142,8 +141,8 @@ describe('DevopsAdoptionDeleteModal', () => {
});
});
it
(
'
emits
segment
sRemoved with the correct variables
'
,
()
=>
{
const
[
params
]
=
wrapper
.
emitted
().
segment
sRemoved
[
0
];
it
(
'
emits
dNamespace
sRemoved with the correct variables
'
,
()
=>
{
const
[
params
]
=
wrapper
.
emitted
().
enabledNamespace
sRemoved
[
0
];
expect
(
params
).
toStrictEqual
([
devopsAdoptionNamespaceData
.
nodes
[
0
].
id
]);
});
...
...
@@ -161,7 +160,7 @@ describe('DevopsAdoptionDeleteModal', () => {
`
(
'
displays a $errorType error if the mutation has a $errorLocation error
'
,
async
({
mutationSpy
,
message
})
=>
{
createComponent
({
delete
Segment
sSpy
:
mutationSpy
});
createComponent
({
delete
EnabledNamespace
sSpy
:
mutationSpy
});
findModal
().
vm
.
$emit
(
'
primary
'
,
mockEvent
);
...
...
@@ -178,7 +177,7 @@ describe('DevopsAdoptionDeleteModal', () => {
it
(
'
calls sentry on top level error
'
,
async
()
=>
{
jest
.
spyOn
(
Sentry
,
'
captureException
'
);
createComponent
({
delete
Segment
sSpy
:
mutateWithErrors
});
createComponent
({
delete
EnabledNamespace
sSpy
:
mutateWithErrors
});
findModal
().
vm
.
$emit
(
'
primary
'
,
mockEvent
);
...
...
ee/spec/frontend/analytics/devops_report/devops_adoption/components/devops_adoption_empty_state_spec.js
View file @
b3a9c3af
...
...
@@ -27,7 +27,6 @@ describe('DevopsAdoptionEmptyState', () => {
afterEach
(()
=>
{
wrapper
.
destroy
();
wrapper
=
null
;
});
it
(
'
contains the correct svg
'
,
()
=>
{
...
...
ee/spec/frontend/analytics/devops_report/devops_adoption/components/devops_adoption_section_spec.js
View file @
b3a9c3af
...
...
@@ -17,11 +17,11 @@ describe('DevopsAdoptionSection', () => {
shallowMount
(
DevopsAdoptionSection
,
{
propsData
:
{
isLoading
:
false
,
has
Segments
Data
:
true
,
has
EnabledNamespace
Data
:
true
,
timestamp
:
'
2020-10-31 23:59
'
,
hasGroupData
:
true
,
cols
:
DEVOPS_ADOPTION_TABLE_CONFIGURATION
[
0
].
cols
,
segment
s
:
devopsAdoptionNamespaceData
,
enabledNamespace
s
:
devopsAdoptionNamespaceData
,
disabledGroupNodes
:
groupNodes
,
searchTerm
:
''
,
isLoadingGroups
:
false
,
...
...
@@ -59,7 +59,7 @@ describe('DevopsAdoptionSection', () => {
});
});
describe
(
'
with
segment
data
'
,
()
=>
{
describe
(
'
with
enabledNamespace
data
'
,
()
=>
{
beforeEach
(()
=>
{
createComponent
();
});
...
...
@@ -81,9 +81,9 @@ describe('DevopsAdoptionSection', () => {
});
});
describe
(
'
with no
segment
data
'
,
()
=>
{
describe
(
'
with no
enabledNamespace
data
'
,
()
=>
{
beforeEach
(()
=>
{
createComponent
({
has
Segments
Data
:
false
});
createComponent
({
has
EnabledNamespace
Data
:
false
});
});
it
(
'
displays an empty state
'
,
()
=>
{
...
...
ee/spec/frontend/analytics/devops_report/devops_adoption/components/devops_adoption_table_spec.js
View file @
b3a9c3af
...
...
@@ -21,7 +21,7 @@ describe('DevopsAdoptionTable', () => {
wrapper
=
mount
(
DevopsAdoptionTable
,
{
propsData
:
{
cols
:
DEVOPS_ADOPTION_TABLE_CONFIGURATION
[
0
].
cols
,
segment
s
:
devopsAdoptionNamespaceData
.
nodes
,
enabledNamespace
s
:
devopsAdoptionNamespaceData
.
nodes
,
},
provide
,
directives
:
{
...
...
@@ -100,15 +100,15 @@ describe('DevopsAdoptionTable', () => {
});
describe
(
'
table fields
'
,
()
=>
{
describe
(
'
segment
name
'
,
()
=>
{
describe
(
'
enabled namespace
name
'
,
()
=>
{
beforeEach
(()
=>
{
createComponent
();
});
it
(
'
displays the correct
segment
name
'
,
()
=>
{
it
(
'
displays the correct name
'
,
()
=>
{
createComponent
();
expect
(
findCol
(
TEST_IDS
.
SEGMENT
).
text
()).
toBe
(
'
Group 1
'
);
expect
(
findCol
(
TEST_IDS
.
NAMESPACE
).
text
()).
toBe
(
'
Group 1
'
);
});
describe
(
'
"This group" badge
'
,
()
=>
{
...
...
@@ -122,7 +122,7 @@ describe('DevopsAdoptionTable', () => {
`
(
'
$scenario
'
,
({
expected
,
provide
})
=>
{
createComponent
({
provide
});
const
badge
=
findColSubComponent
(
TEST_IDS
.
SEGMENT
,
GlBadge
);
const
badge
=
findColSubComponent
(
TEST_IDS
.
NAMESPACE
,
GlBadge
);
expect
(
badge
.
exists
()).
toBe
(
expected
);
});
...
...
@@ -134,7 +134,7 @@ describe('DevopsAdoptionTable', () => {
});
it
(
'
grays the text out
'
,
()
=>
{
const
name
=
findColRowChild
(
TEST_IDS
.
SEGMENT
,
1
,
'
span
'
);
const
name
=
findColRowChild
(
TEST_IDS
.
NAMESPACE
,
1
,
'
span
'
);
expect
(
name
.
classes
()).
toStrictEqual
([
'
gl-text-gray-400
'
]);
});
...
...
@@ -143,7 +143,7 @@ describe('DevopsAdoptionTable', () => {
let
icon
;
beforeEach
(()
=>
{
icon
=
findColRowChild
(
TEST_IDS
.
SEGMENT
,
1
,
GlIcon
);
icon
=
findColRowChild
(
TEST_IDS
.
NAMESPACE
,
1
,
GlIcon
);
});
it
(
'
displays the icon
'
,
()
=>
{
...
...
@@ -198,7 +198,7 @@ describe('DevopsAdoptionTable', () => {
createComponent
();
wrapper
.
setData
({
selected
Segment
:
devopsAdoptionNamespaceData
.
nodes
[
0
],
selected
Namespace
:
devopsAdoptionNamespaceData
.
nodes
[
0
],
});
});
...
...
@@ -217,14 +217,14 @@ describe('DevopsAdoptionTable', () => {
headers
=
findTable
().
findAll
(
`[data-testid="
${
TEST_IDS
.
TABLE_HEADERS
}
"]`
);
});
it
(
'
sorts the
segment
s by name
'
,
async
()
=>
{
expect
(
findCol
(
TEST_IDS
.
SEGMENT
).
text
()).
toBe
(
'
Group 1
'
);
it
(
'
sorts the
namespace
s by name
'
,
async
()
=>
{
expect
(
findCol
(
TEST_IDS
.
NAMESPACE
).
text
()).
toBe
(
'
Group 1
'
);
headers
.
at
(
0
).
trigger
(
'
click
'
);
await
nextTick
();
expect
(
findCol
(
TEST_IDS
.
SEGMENT
).
text
()).
toBe
(
'
Group 2
'
);
expect
(
findCol
(
TEST_IDS
.
NAMESPACE
).
text
()).
toBe
(
'
Group 2
'
);
});
it
(
'
should update local storage when the sort column changes
'
,
async
()
=>
{
...
...
ee/spec/frontend/analytics/devops_report/devops_adoption/mock_data.js
View file @
b3a9c3af
...
...
@@ -95,8 +95,6 @@ export const devopsAdoptionTableHeaders = [
},
];
export
const
segmentName
=
'
Foooo
'
;
export
const
genericErrorMessage
=
'
An error occurred while saving changes. Please try again.
'
;
export
const
dataErrorMessage
=
'
Name already taken.
'
;
...
...
ee/spec/frontend/analytics/devops_report/devops_adoption/utils/cache_updates_spec.js
View file @
b3a9c3af
import
{
delete
Segment
sFromCache
,
add
Segment
sToCache
,
delete
EnabledNamespace
sFromCache
,
add
EnabledNamespace
sToCache
,
}
from
'
ee/analytics/devops_report/devops_adoption/utils/cache_updates
'
;
import
{
devopsAdoptionNamespaceData
}
from
'
../mock_data
'
;
describe
(
'
add
Segment
sToCache
'
,
()
=>
{
describe
(
'
add
EnabledNamespace
sToCache
'
,
()
=>
{
const
store
=
{
readQuery
:
jest
.
fn
(()
=>
({
devopsAdoptionEnabledNamespaces
:
{
nodes
:
[]
}
})),
writeQuery
:
jest
.
fn
(),
};
it
(
'
calls writeQuery with the correct response
'
,
()
=>
{
add
Segment
sToCache
(
store
,
devopsAdoptionNamespaceData
.
nodes
);
add
EnabledNamespace
sToCache
(
store
,
devopsAdoptionNamespaceData
.
nodes
);
expect
(
store
.
writeQuery
).
toHaveBeenCalledWith
(
expect
.
objectContaining
({
...
...
@@ -25,7 +25,7 @@ describe('addSegmentsToCache', () => {
});
});
describe
(
'
delete
Segment
sFromCache
'
,
()
=>
{
describe
(
'
delete
EnabledNamespace
sFromCache
'
,
()
=>
{
const
store
=
{
readQuery
:
jest
.
fn
(()
=>
({
devopsAdoptionEnabledNamespaces
:
devopsAdoptionNamespaceData
})),
writeQuery
:
jest
.
fn
(),
...
...
@@ -33,7 +33,7 @@ describe('deleteSegmentsFromCache', () => {
it
(
'
calls writeQuery with the correct response
'
,
()
=>
{
// Remove the item at the first index
delete
Segment
sFromCache
(
store
,
[
devopsAdoptionNamespaceData
.
nodes
[
0
].
id
]);
delete
EnabledNamespace
sFromCache
(
store
,
[
devopsAdoptionNamespaceData
.
nodes
[
0
].
id
]);
expect
(
store
.
writeQuery
).
toHaveBeenCalledWith
(
expect
.
not
.
objectContaining
({
...
...
ee/spec/frontend/analytics/devops_report/devops_adoption/utils/helpers_spec.js
View file @
b3a9c3af
...
...
@@ -8,15 +8,15 @@ describe('shouldPollTableData', () => {
const
previousDay
=
'
2020-07-05T00:00:00.000Z
'
;
it
.
each
`
scenario
| segments
| timestamp | openModal | expected
${
'
no
segment data
'
}
|
${[]}
|
${
mockDate
}
|
${
false
}
|
${
true
}
${
'
no timestamp
'
}
|
${
comepleteData
}
|
${
null
}
|
${
false
}
|
${
true
}
${
'
open modal
'
}
|
${
comepleteData
}
|
${
mockDate
}
|
${
true
}
|
${
false
}
${
'
segment data, timestamp is today, modal is closed
'
}
|
${
comepleteData
}
|
${
mockDate
}
|
${
false
}
|
${
false
}
${
'
segment data, timestamp is yesterday, modal is closed
'
}
|
${
comepleteData
}
|
${
previousDay
}
|
${
false
}
|
${
true
}
${
'
segment data, timestamp is today, modal is open
'
}
|
${
comepleteData
}
|
${
mockDate
}
|
${
true
}
|
${
false
}
${
'
pending
segment data, timestamp is today, modal is closed
'
}
|
${
pendingData
}
|
${
mockDate
}
|
${
false
}
|
${
true
}
`
(
'
returns $expected when $scenario
'
,
({
segment
s
,
timestamp
,
openModal
,
expected
})
=>
{
expect
(
shouldPollTableData
({
segment
s
,
timestamp
,
openModal
})).
toBe
(
expected
);
scenario
| enabledNamespaces
| timestamp | openModal | expected
${
'
no
namespaces data
'
}
|
${[]}
|
${
mockDate
}
|
${
false
}
|
${
true
}
${
'
no timestamp
'
}
|
${
comepleteData
}
|
${
null
}
|
${
false
}
|
${
true
}
${
'
open modal
'
}
|
${
comepleteData
}
|
${
mockDate
}
|
${
true
}
|
${
false
}
${
'
namespaces data, timestamp is today, modal is closed
'
}
|
${
comepleteData
}
|
${
mockDate
}
|
${
false
}
|
${
false
}
${
'
namespaces data, timestamp is yesterday, modal is closed
'
}
|
${
comepleteData
}
|
${
previousDay
}
|
${
false
}
|
${
true
}
${
'
namespaces data, timestamp is today, modal is open
'
}
|
${
comepleteData
}
|
${
mockDate
}
|
${
true
}
|
${
false
}
${
'
pending
namespaces data, timestamp is today, modal is closed
'
}
|
${
pendingData
}
|
${
mockDate
}
|
${
false
}
|
${
true
}
`
(
'
returns $expected when $scenario
'
,
({
enabledNamespace
s
,
timestamp
,
openModal
,
expected
})
=>
{
expect
(
shouldPollTableData
({
enabledNamespace
s
,
timestamp
,
openModal
})).
toBe
(
expected
);
});
});
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