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