Commit e8efbd68 authored by Jose Vargas's avatar Jose Vargas

Add feature specs for CI minutes analytics

parent 59b92d67
......@@ -78,7 +78,7 @@ 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"
......
# 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('.gl-new-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