summaryrefslogtreecommitdiff
path: root/spec/frontend/jira_connect/subscriptions/pages/sign_in/sign_in_page_spec.js
diff options
context:
space:
mode:
Diffstat (limited to 'spec/frontend/jira_connect/subscriptions/pages/sign_in/sign_in_page_spec.js')
-rw-r--r--spec/frontend/jira_connect/subscriptions/pages/sign_in/sign_in_page_spec.js49
1 files changed, 14 insertions, 35 deletions
diff --git a/spec/frontend/jira_connect/subscriptions/pages/sign_in/sign_in_page_spec.js b/spec/frontend/jira_connect/subscriptions/pages/sign_in/sign_in_page_spec.js
index c12a45b2f41..b27eba6b040 100644
--- a/spec/frontend/jira_connect/subscriptions/pages/sign_in/sign_in_page_spec.js
+++ b/spec/frontend/jira_connect/subscriptions/pages/sign_in/sign_in_page_spec.js
@@ -15,7 +15,7 @@ describe('SignInPage', () => {
const createComponent = ({
props = {},
jiraConnectOauthEnabled,
- jiraConnectOauthSelfManagedEnabled,
+ publicKeyStorageEnabled,
} = {}) => {
store = createStore();
@@ -24,10 +24,13 @@ describe('SignInPage', () => {
provide: {
glFeatures: {
jiraConnectOauth: jiraConnectOauthEnabled,
- jiraConnectOauthSelfManaged: jiraConnectOauthSelfManagedEnabled,
},
},
- propsData: { hasSubscriptions: false, ...props },
+ propsData: {
+ hasSubscriptions: false,
+ publicKeyStorageEnabled,
+ ...props,
+ },
});
};
@@ -36,47 +39,23 @@ describe('SignInPage', () => {
});
it.each`
- jiraConnectOauthEnabled | jiraConnectOauthSelfManagedEnabled | shouldRenderDotCom | shouldRenderMultiversion
- ${false} | ${false} | ${true} | ${false}
- ${false} | ${true} | ${true} | ${false}
- ${true} | ${false} | ${true} | ${false}
- ${true} | ${true} | ${false} | ${true}
+ jiraConnectOauthEnabled | publicKeyStorageEnabled | shouldRenderDotCom | shouldRenderMultiversion
+ ${false} | ${true} | ${true} | ${false}
+ ${false} | ${false} | ${true} | ${false}
+ ${true} | ${true} | ${false} | ${true}
+ ${true} | ${false} | ${true} | ${false}
`(
- 'renders correct component when jiraConnectOauth is $jiraConnectOauthEnabled and jiraConnectOauthSelfManaged is $jiraConnectOauthSelfManagedEnabled',
+ 'renders correct component when jiraConnectOauth is $jiraConnectOauthEnabled',
({
jiraConnectOauthEnabled,
- jiraConnectOauthSelfManagedEnabled,
+ publicKeyStorageEnabled,
shouldRenderDotCom,
shouldRenderMultiversion,
}) => {
- createComponent({ jiraConnectOauthEnabled, jiraConnectOauthSelfManagedEnabled });
+ createComponent({ jiraConnectOauthEnabled, publicKeyStorageEnabled });
expect(findSignInGitlabCom().exists()).toBe(shouldRenderDotCom);
expect(findSignInGitabMultiversion().exists()).toBe(shouldRenderMultiversion);
},
);
-
- describe('when jiraConnectOauthSelfManaged is false', () => {
- beforeEach(() => {
- createComponent({ jiraConnectOauthSelfManaged: false, props: { hasSubscriptions: true } });
- });
-
- it('renders SignInGitlabCom with correct props', () => {
- expect(findSignInGitlabCom().props()).toEqual({ hasSubscriptions: true });
- });
-
- describe('when error event is emitted', () => {
- it('emits another error event', () => {
- findSignInGitlabCom().vm.$emit('error');
- expect(wrapper.emitted('error')).toHaveLength(1);
- });
- });
-
- describe('when sign-in-oauth event is emitted', () => {
- it('emits another sign-in-oauth event', () => {
- findSignInGitlabCom().vm.$emit('sign-in-oauth');
- expect(wrapper.emitted('sign-in-oauth')[0]).toEqual([]);
- });
- });
- });
});