Commit a029a4b7 authored by Justin Ho's avatar Justin Ho

Refactor specs with reviewer feedback

Update feature flag description
parent 0a7b35b8
......@@ -20,7 +20,7 @@ class JiraConnect::SubscriptionsController < JiraConnect::ApplicationController
before_action :verify_qsh_claim!, only: :index
before_action :authenticate_user!, only: :create
before_action do
push_frontend_feature_flag(:new_jira_connect_ui, type: :development)
push_frontend_feature_flag(:new_jira_connect_ui, type: :development, default_enabled: :yaml)
end
def index
......
---
name: new_jira_connect_ui
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/49202
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/50692
rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/295647
milestone: '13.7'
milestone: '13.8'
type: development
group: group::ecosystem
default_enabled: false
......@@ -5,23 +5,35 @@ import JiraConnectApp from '~/jira_connect/components/app.vue';
describe('JiraConnectApp', () => {
let wrapper;
const createComponent = ({ ...options }) => {
const createComponent = (options = {}) => {
wrapper = shallowMount(JiraConnectApp, {
provide: {
glFeatures: { newJiraConnectUi: true },
},
...options,
});
};
afterEach(() => {
if (wrapper) {
wrapper.destroy();
wrapper = null;
}
wrapper.destroy();
wrapper = null;
});
const findHeader = () => wrapper.find('h3');
const findHeaderText = () => wrapper.find('h3').text();
const findHeaderText = () => findHeader().text();
describe('template', () => {
it('renders new UI', () => {
createComponent({
provide: {
glFeatures: { newJiraConnectUi: true },
},
});
expect(findHeader().exists()).toBe(true);
expect(findHeaderText()).toBe('Linked namespaces');
});
describe('newJiraConnectUi is false', () => {
it('does not render new UI', () => {
createComponent({
......@@ -33,18 +45,5 @@ describe('JiraConnectApp', () => {
expect(findHeader().exists()).toBe(false);
});
});
describe('newJiraConnectUi is true', () => {
it('renders new UI', () => {
createComponent({
provide: {
glFeatures: { newJiraConnectUi: true },
},
});
expect(findHeader().exists()).toBe(true);
expect(findHeaderText()).toBe('Linked namespaces');
});
});
});
});
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