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
e1c2a473
Commit
e1c2a473
authored
Oct 07, 2021
by
Albert Salim
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use import for JSON fixtures
- ee/spec/frontend/analytics - ee/spec/frontend/dora - ee/spec/frontend/epic
parent
d6fb5dd9
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
13 additions
and
33 deletions
+13
-33
ee/spec/frontend/analytics/cycle_analytics/mock_data.js
ee/spec/frontend/analytics/cycle_analytics/mock_data.js
+2
-3
ee/spec/frontend/analytics/devops_report/devops_adoption/mock_data.js
...tend/analytics/devops_report/devops_adoption/mock_data.js
+1
-4
ee/spec/frontend/dora/components/deployment_frequency_charts_spec.js
...ntend/dora/components/deployment_frequency_charts_spec.js
+3
-10
ee/spec/frontend/dora/components/lead_time_charts_spec.js
ee/spec/frontend/dora/components/lead_time_charts_spec.js
+3
-10
ee/spec/frontend/dora/components/util_spec.js
ee/spec/frontend/dora/components/util_spec.js
+1
-4
ee/spec/frontend/epic/mock_data.js
ee/spec/frontend/epic/mock_data.js
+3
-2
No files found.
ee/spec/frontend/analytics/cycle_analytics/mock_data.js
View file @
e1c2a473
import
tasksByType
from
'
test_fixtures/analytics/charts/type_of_work/tasks_by_type.json
'
;
import
{
uniq
}
from
'
lodash
'
;
import
{
TASKS_BY_TYPE_SUBJECT_ISSUE
,
...
...
@@ -182,9 +183,7 @@ export const labelEndEvent = customStageLabelEvents.find(
const
dateRange
=
getDatesInRange
(
createdAfter
,
createdBefore
,
toYmd
);
export
const
apiTasksByTypeData
=
getJSONFixture
(
'
analytics/charts/type_of_work/tasks_by_type.json
'
,
).
map
((
labelData
)
=>
{
export
const
apiTasksByTypeData
=
tasksByType
.
map
((
labelData
)
=>
{
// add data points for our mock date range
const
maxValue
=
10
;
const
series
=
dateRange
.
map
((
date
)
=>
[
date
,
Math
.
floor
(
Math
.
random
()
*
Math
.
floor
(
maxValue
))]);
...
...
ee/spec/frontend/analytics/devops_report/devops_adoption/mock_data.js
View file @
e1c2a473
import
json
from
'
test_fixtures/graphql/analytics/devops_report/devops_adoption/graphql/queries/devops_adoption_enabled_namespaces.query.graphql.json
'
;
import
{
DEVOPS_ADOPTION_TABLE_CONFIGURATION
}
from
'
ee/analytics/devops_report/devops_adoption/constants
'
;
import
{
getIdFromGraphQLId
}
from
'
~/graphql_shared/utils
'
;
const
json
=
getJSONFixture
(
'
graphql/analytics/devops_report/devops_adoption/graphql/queries/devops_adoption_enabled_namespaces.query.graphql.json
'
,
);
export
const
devopsAdoptionNamespaceData
=
json
.
data
.
devopsAdoptionEnabledNamespaces
;
export
const
groupData
=
devopsAdoptionNamespaceData
.
nodes
.
map
((
node
)
=>
{
...
...
ee/spec/frontend/dora/components/deployment_frequency_charts_spec.js
View file @
e1c2a473
import
*
as
Sentry
from
'
@sentry/browser
'
;
import
{
shallowMount
}
from
'
@vue/test-utils
'
;
import
MockAdapter
from
'
axios-mock-adapter
'
;
import
lastWeekData
from
'
test_fixtures/api/dora/metrics/daily_deployment_frequency_for_last_week.json
'
;
import
lastMonthData
from
'
test_fixtures/api/dora/metrics/daily_deployment_frequency_for_last_month.json
'
;
import
last90DaysData
from
'
test_fixtures/api/dora/metrics/daily_deployment_frequency_for_last_90_days.json
'
;
import
{
useFixturesFakeDate
}
from
'
helpers/fake_date
'
;
import
createFlash
from
'
~/flash
'
;
import
axios
from
'
~/lib/utils/axios_utils
'
;
...
...
@@ -9,16 +12,6 @@ import CiCdAnalyticsCharts from '~/vue_shared/components/ci_cd_analytics/ci_cd_a
jest
.
mock
(
'
~/flash
'
);
const
lastWeekData
=
getJSONFixture
(
'
api/dora/metrics/daily_deployment_frequency_for_last_week.json
'
,
);
const
lastMonthData
=
getJSONFixture
(
'
api/dora/metrics/daily_deployment_frequency_for_last_month.json
'
,
);
const
last90DaysData
=
getJSONFixture
(
'
api/dora/metrics/daily_deployment_frequency_for_last_90_days.json
'
,
);
describe
(
'
deployment_frequency_charts.vue
'
,
()
=>
{
useFixturesFakeDate
();
...
...
ee/spec/frontend/dora/components/lead_time_charts_spec.js
View file @
e1c2a473
import
{
GlSprintf
}
from
'
@gitlab/ui
'
;
import
{
mount
,
shallowMount
}
from
'
@vue/test-utils
'
;
import
MockAdapter
from
'
axios-mock-adapter
'
;
import
lastWeekData
from
'
test_fixtures/api/dora/metrics/daily_lead_time_for_changes_for_last_week.json
'
;
import
lastMonthData
from
'
test_fixtures/api/dora/metrics/daily_lead_time_for_changes_for_last_month.json
'
;
import
last90DaysData
from
'
test_fixtures/api/dora/metrics/daily_lead_time_for_changes_for_last_90_days.json
'
;
import
{
useFixturesFakeDate
}
from
'
helpers/fake_date
'
;
import
createFlash
from
'
~/flash
'
;
import
axios
from
'
~/lib/utils/axios_utils
'
;
...
...
@@ -9,16 +12,6 @@ import CiCdAnalyticsCharts from '~/vue_shared/components/ci_cd_analytics/ci_cd_a
jest
.
mock
(
'
~/flash
'
);
const
lastWeekData
=
getJSONFixture
(
'
api/dora/metrics/daily_lead_time_for_changes_for_last_week.json
'
,
);
const
lastMonthData
=
getJSONFixture
(
'
api/dora/metrics/daily_lead_time_for_changes_for_last_month.json
'
,
);
const
last90DaysData
=
getJSONFixture
(
'
api/dora/metrics/daily_lead_time_for_changes_for_last_90_days.json
'
,
);
describe
(
'
lead_time_charts.vue
'
,
()
=>
{
useFixturesFakeDate
();
...
...
ee/spec/frontend/dora/components/util_spec.js
View file @
e1c2a473
import
lastWeekData
from
'
test_fixtures/api/dora/metrics/daily_lead_time_for_changes_for_last_week.json
'
;
import
{
apiDataToChartSeries
,
buildNullSeriesForLeadTimeChart
}
from
'
ee/dora/components/util
'
;
const
lastWeekData
=
getJSONFixture
(
'
api/dora/metrics/daily_lead_time_for_changes_for_last_week.json
'
,
);
describe
(
'
ee/dora/components/util.js
'
,
()
=>
{
describe
(
'
apiDataToChartSeries
'
,
()
=>
{
it
(
'
transforms the data from the API into data the chart component can use
'
,
()
=>
{
...
...
ee/spec/frontend/epic/mock_data.js
View file @
e1c2a473
import
metaFixture
from
'
test_fixtures/epic/mock_meta.json
'
;
import
mockDataFixture
from
'
test_fixtures/epic/mock_data.json
'
;
import
{
TEST_HOST
}
from
'
spec/test_constants
'
;
import
{
convertObjectPropsToCamelCase
}
from
'
~/lib/utils/common_utils
'
;
const
metaFixture
=
getJSONFixture
(
'
epic/mock_meta.json
'
);
const
meta
=
JSON
.
parse
(
metaFixture
.
meta
);
const
initial
=
JSON
.
parse
(
metaFixture
.
initial
);
...
...
@@ -14,7 +15,7 @@ export const mockEpicMeta = {
export
const
mockEpicData
=
convertObjectPropsToCamelCase
(
{
...
getJSONFixture
(
'
epic/mock_data.json
'
)
,
...
mockDataFixture
,
...
initial
,
endpoint
:
TEST_HOST
,
sidebarCollapsed
:
false
,
...
...
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