Skip to content
Snippets Groups Projects

Make #wlif_issuer_url work for group or project

Merged Eduardo Sanz García requested to merge eduardosanz/gc-iam-improvements-5 into master
All threads resolved!
2 files
+ 35
7
Compare changes
  • Side-by-side
  • Inline
Files
2
@@ -2,23 +2,23 @@ import { GlLink, GlSprintf } from '@gitlab/ui';
@@ -2,23 +2,23 @@ import { GlLink, GlSprintf } from '@gitlab/ui';
import { shallowMount } from '@vue/test-utils';
import { shallowMount } from '@vue/test-utils';
import { STATE_GUIDED } from 'ee/integrations/edit/components/google_cloud_iam/constants';
import { STATE_GUIDED } from 'ee/integrations/edit/components/google_cloud_iam/constants';
import ManualSetup from 'ee/integrations/edit/components/google_cloud_iam/manual_setup.vue';
import ManualSetup from 'ee/integrations/edit/components/google_cloud_iam/manual_setup.vue';
 
import ClipboardButton from '~/vue_shared/components/clipboard_button.vue';
describe('ManualSetup', () => {
describe('ManualSetup', () => {
let wrapper;
let wrapper;
const createComponent = () => {
const createComponent = (propsData = {}) => {
wrapper = shallowMount(ManualSetup, { stubs: { GlSprintf } });
wrapper = shallowMount(ManualSetup, { propsData, stubs: { GlSprintf } });
};
};
const findFirstLink = () => wrapper.findAllComponents(GlLink).at(0);
const findLinks = () => wrapper.findAllComponents(GlLink);
const findFirstLink = () => findLinks().at(0);
beforeEach(() => {
const findClipboardButtons = () => wrapper.findAllComponents(ClipboardButton);
createComponent();
});
describe('Switch to guided setup link', () => {
describe('Switch to guided setup link', () => {
let switchLink;
let switchLink;
beforeEach(() => {
beforeEach(() => {
 
createComponent();
switchLink = findFirstLink();
switchLink = findFirstLink();
});
});
@@ -35,4 +35,20 @@ describe('ManualSetup', () => {
@@ -35,4 +35,20 @@ describe('ManualSetup', () => {
expect(wrapper.emitted().show[0]).toContain(STATE_GUIDED);
expect(wrapper.emitted().show[0]).toContain(STATE_GUIDED);
});
});
});
});
 
 
it('renders links to help doc page and corresponding clipboard button', () => {
 
createComponent();
 
 
const helpPath = '/help/integration/google_cloud_iam.html#with-the-google-cloud-cli';
 
expect(findLinks().at(2).attributes('href')).toBe(helpPath);
 
expect(findClipboardButtons().at(0).props('text')).toBe(helpPath);
 
});
 
 
it('show the workload identity federation provider issuer and corresponding clipboard button', () => {
 
const wlifIssuer = 'https://test.com';
 
createComponent({ wlifIssuer });
 
 
expect(wrapper.text()).toContain(wlifIssuer);
 
expect(findClipboardButtons().at(1).props('text')).toBe(wlifIssuer);
 
});
});
});
Loading