Commit 3100504e authored by Andrew Fontaine's avatar Andrew Fontaine

Merge branch 'jivanvl-add-integration-tests-ci-minutes' into 'master'

Add feature specs for CI minutes analytics

See merge request gitlab-org/gitlab!68078
parents d6c4d11e d95fa852
......@@ -78,12 +78,13 @@ export default {
<div>
<div class="gl-display-flex gl-my-3">
<h5 class="gl-flex-grow-1">{{ $options.USAGE_BY_PROJECT }}</h5>
<gl-dropdown v-if="!isDataEmpty" :text="selectedMonth">
<gl-dropdown v-if="!isDataEmpty" :text="selectedMonth" data-testid="project-month-dropdown">
<gl-dropdown-item
v-for="(month, index) in months"
:key="index"
:is-checked="selectedMonth === month"
is-check-item
data-testid="month-dropdown-item"
@click="changeSelectedMonth(month)"
>
{{ month }}
......
# frozen_string_literal: true
require 'spec_helper'
RSpec.describe 'CI minutes', :js do
let_it_be(:user) { create(:user) }
let_it_be(:project) { create(:project, name: 'Project 1', namespace: user.namespace) }
def create_ci_minutes_usage(minutes, date)
create(:ci_namespace_monthly_usage, namespace: user.namespace, amount_used: minutes, date: date)
create(:ci_project_monthly_usage, project: project, amount_used: minutes, date: date)
end
before do
create_ci_minutes_usage(50, Date.new(2021, 5, 1))
create_ci_minutes_usage(60, Date.new(2021, 6, 1))
sign_in(user)
visit profile_usage_quotas_path
end
it 'renders a dropdown with the months of available analytics' do
wait_for_requests
page.find('[data-testid="project-month-dropdown"]').click
page.within '[data-testid="project-month-dropdown"]' do
expect(page.all('[data-testid="month-dropdown-item"]').size).to eq 2
end
end
end
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