Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'spec/frontend/google_cloud/service_accounts/list_spec.js')
-rw-r--r--spec/frontend/google_cloud/service_accounts/list_spec.js29
1 files changed, 27 insertions, 2 deletions
diff --git a/spec/frontend/google_cloud/service_accounts/list_spec.js b/spec/frontend/google_cloud/service_accounts/list_spec.js
index 7a76a893757..c2bd2005b5d 100644
--- a/spec/frontend/google_cloud/service_accounts/list_spec.js
+++ b/spec/frontend/google_cloud/service_accounts/list_spec.js
@@ -1,5 +1,5 @@
import { mount } from '@vue/test-utils';
-import { GlAlert, GlButton, GlEmptyState, GlTable } from '@gitlab/ui';
+import { GlAlert, GlButton, GlEmptyState, GlLink, GlTable } from '@gitlab/ui';
import ServiceAccountsList from '~/google_cloud/service_accounts/list.vue';
describe('google_cloud/service_accounts/list', () => {
@@ -45,7 +45,26 @@ describe('google_cloud/service_accounts/list', () => {
beforeEach(() => {
const propsData = {
- list: [{}, {}, {}],
+ list: [
+ {
+ ref: '*',
+ gcp_project: 'gcp-project-123',
+ service_account_exists: true,
+ service_account_key_exists: true,
+ },
+ {
+ ref: 'prod',
+ gcp_project: 'gcp-project-456',
+ service_account_exists: true,
+ service_account_key_exists: true,
+ },
+ {
+ ref: 'stag',
+ gcp_project: 'gcp-project-789',
+ service_account_exists: true,
+ service_account_key_exists: true,
+ },
+ ],
createUrl: '#create-url',
emptyIllustrationUrl: '#empty-illustration-url',
};
@@ -68,6 +87,12 @@ describe('google_cloud/service_accounts/list', () => {
expect(findRows().length).toBe(4);
});
+ it('table row must contain link to the google cloud console', () => {
+ expect(findRows().at(1).findComponent(GlLink).attributes('href')).toBe(
+ `${ServiceAccountsList.GOOGLE_CONSOLE_URL}?project=gcp-project-123`,
+ );
+ });
+
it('shows the link to create new service accounts', () => {
const button = findButton();
expect(button.exists()).toBe(true);