Commit 4da2f986 authored by Ezekiel Kigbo's avatar Ezekiel Kigbo

Added additional test data to fixtures

Mock chart data request for cycle analytics base specs
parent 5af819b7
......@@ -127,54 +127,12 @@ export default {
state.isSavingCustomStage = false;
},
[types.REQUEST_TASKS_BY_TYPE_DATA](state) {
// [
// {
// "label": {
// "id": 1,
// "title": "label 1",
// "color": "#428BCA",
// "text_color": "#FFFFFF"
// },
// "series": [
// [
// "2018-01-01",
// 23
// ],
// [
// "2018-01-02",
// 5
// ]
// ]
// },
// {
// "label": {
// "id": 2,
// "title": "label 3",
// "color": "#428BCA",
// "text_color": "#FFFFFF"
// },
// "series": [
// [
// "2018-01-01",
// 3
// ],
// [
// "2018-01-03",
// 10
// ]
// ]
// }
// ]
// transforms the raw data into a dictionary
/*
{
labelId: {
issues: [],
merge_requests: []
}
}
*/
},
[types.RECEIVE_TASKS_BY_TYPE_DATA_ERROR](state) {},
[types.RECEIVE_TASKS_BY_TYPE_DATA_SUCCESS](state) {},
state.isLoadingChartData = true;
},
[types.RECEIVE_TASKS_BY_TYPE_DATA_ERROR](state) {
state.isLoadingChartData = false;
},
[types.RECEIVE_TASKS_BY_TYPE_DATA_SUCCESS](state) {
state.isLoadingChartData = false;
},
};
......@@ -103,3 +103,5 @@ export const customStageEvents = [
labelStartEvent,
labelStopEvent,
];
export const tasksByTypeData = getJSONFixture('analytics/type_of_work/tasks_by_type.json');
......@@ -108,8 +108,16 @@ describe 'Analytics (JavaScript fixtures)', :sidekiq_inline do
render_views
let(:label) { create(:group_label, group: group) }
let(:label2) { create(:group_label, group: group) }
let(:label3) { create(:group_label, group: group) }
before do
5.times do |i|
create(:labeled_issue, created_at: i.days.ago, project: create(:project, group: group), labels: [label])
create(:labeled_issue, created_at: i.days.ago, project: create(:project, group: group), labels: [label2])
create(:labeled_issue, created_at: i.days.ago, project: create(:project, group: group), labels: [label3])
end
stub_licensed_features(type_of_work_analytics: true)
stub_feature_flags(Gitlab::Analytics::TASKS_BY_TYPE_CHART_FEATURE_FLAG => true)
......@@ -118,8 +126,8 @@ describe 'Analytics (JavaScript fixtures)', :sidekiq_inline do
sign_in(user)
end
it 'analytics/tasks_by_type.json' do
params = { group_id: group.full_path, label_ids: [label.id], created_after: 10.days.ago, subject: 'Issue' }
it 'analytics/type_of_work/tasks_by_type.json' do
params = { group_id: group.full_path, label_ids: [label.id, label2.id, label3.id], created_after: 10.days.ago, subject: 'Issue' }
get(:show, params: params, format: :json)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment