Commit 22229805 authored by Phil Hughes's avatar Phil Hughes

Merge branch '325737-feature-flag-rollout-of-runner_detailed_view_vue_ui' into 'master'

Remove enabled runner_detailed_view_vue_ui flag

See merge request gitlab-org/gitlab!68839
parents a5be5a1b e7644ad7
......@@ -4,15 +4,7 @@
- page_title "##{@runner.id} (#{@runner.short_sha})"
- add_to_breadcrumbs _('Runners'), admin_runners_path
- if Feature.enabled?(:runner_detailed_view_vue_ui, current_user, default_enabled: :yaml)
#js-runner-details{ data: {runner_id: @runner.id} }
- else
%h2.page-title
= s_('Runners|Runner #%{runner_id}' % { runner_id: @runner.id })
= render 'shared/runners/runner_type_badge', runner: @runner
= render 'shared/runners/runner_type_alert', runner: @runner
.gl-mb-6
= render 'shared/runners/form', runner: @runner, runner_form_url: admin_runner_path(@runner), in_gitlab_com_admin_context: Gitlab.com?
#js-runner-details{ data: {runner_id: @runner.id} }
.row
.col-md-6
......
---
name: runner_detailed_view_vue_ui
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/57256
rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/325737
milestone: '13.11'
type: development
group: group::runner
default_enabled: true
import {
modelToUpdateMutationVariables as cemodelToUpdateMutationVariables,
modelToUpdateMutationVariables as ceModelToUpdateMutationVariables,
runnerToModel as ceRunnerToModel,
} from '~/runner/runner_details/runner_update_form_utils';
......@@ -16,7 +16,7 @@ export const modelToUpdateMutationVariables = (model) => {
return {
input: {
...cemodelToUpdateMutationVariables(model).input,
...ceModelToUpdateMutationVariables(model).input,
privateProjectsMinutesCostFactor:
privateProjectsMinutesCostFactor !== '' ? privateProjectsMinutesCostFactor : null,
publicProjectsMinutesCostFactor:
......
import { mount } from '@vue/test-utils';
import RunnerUpdateCostFactorFields from 'ee/runner/components/runner_update_cost_factor_fields.vue';
import { extendedWrapper } from 'helpers/vue_test_utils_helper';
import { runnerData } from 'jest/runner/mock_data';
const mockRunner = runnerData.data.runner;
describe('RunnerUpdateCostFactorFields', () => {
let wrapper;
const findPrivateProjectsCostFactor = () =>
wrapper.findByTestId('runner-field-private-projects-cost-factor');
const findPublicProjectsCostFactor = () =>
wrapper.findByTestId('runner-field-public-projects-cost-factor');
const triggerInput = (formGroup, value) => {
const input = formGroup.find('input');
input.element.value = value;
input.trigger('input');
};
const createComponent = () => {
wrapper = extendedWrapper(
mount(RunnerUpdateCostFactorFields, {
propsData: {
value: mockRunner,
},
}),
);
};
describe('when on dot_com', () => {
beforeEach(() => {
gon.dot_com = true;
createComponent();
});
it('shows cost factor fields', () => {
expect(findPrivateProjectsCostFactor().exists()).toBe(true);
expect(findPublicProjectsCostFactor().exists()).toBe(true);
});
it('handles input of private cost factor', async () => {
triggerInput(findPrivateProjectsCostFactor(), '3.50');
expect(wrapper.emitted('input').length).toBe(1);
expect(wrapper.emitted('input')[0]).toEqual([
{
...mockRunner,
privateProjectsMinutesCostFactor: 3.5,
},
]);
});
it('handles input of public cost factor', async () => {
triggerInput(findPublicProjectsCostFactor(), '2.50');
expect(wrapper.emitted('input').length).toBe(1);
expect(wrapper.emitted('input')[0]).toEqual([
{
...mockRunner,
publicProjectsMinutesCostFactor: 2.5,
},
]);
});
});
describe('when self-hosted', () => {
beforeEach(() => {
gon.dot_com = false;
createComponent();
});
it('does not show cost factor fields', () => {
expect(findPrivateProjectsCostFactor().exists()).toBe(false);
expect(findPublicProjectsCostFactor().exists()).toBe(false);
});
});
});
......@@ -23,10 +23,6 @@ RSpec.describe Admin::RunnersController do
describe '#show' do
render_views
before do
stub_feature_flags(runner_detailed_view_vue_ui: false)
end
let_it_be(:project) { create(:project) }
let_it_be(:project_two) { create(:project) }
......@@ -61,30 +57,6 @@ RSpec.describe Admin::RunnersController do
expect(response).to have_gitlab_http_status(:ok)
end
describe 'Cost factors values' do
context 'when it is Gitlab.com' do
before do
expect(Gitlab).to receive(:com?).at_least(:once) { true }
end
it 'renders cost factors fields' do
get :show, params: { id: runner.id }
expect(response.body).to match /Private projects Minutes cost factor/
expect(response.body).to match /Public projects Minutes cost factor/
end
end
context 'when it is not Gitlab.com' do
it 'does not show cost factor fields' do
get :show, params: { id: runner.id }
expect(response.body).not_to match /Private projects Minutes cost factor/
expect(response.body).not_to match /Public projects Minutes cost factor/
end
end
end
end
describe '#update' do
......
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