diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-06-10 21:09:15 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-06-10 21:09:15 +0300 |
commit | f6905d2ed293ccde386ba2798e7a623c228e8f51 (patch) | |
tree | 83e7defc9e9ec94462c3bc3d86e4ca0cbc4b7c21 /spec/frontend/clusters_list | |
parent | f2f748c08166ef350aa4183242c3611f6617f651 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/frontend/clusters_list')
-rw-r--r-- | spec/frontend/clusters_list/components/clusters_spec.js | 26 | ||||
-rw-r--r-- | spec/frontend/clusters_list/mock_data.js | 3 |
2 files changed, 28 insertions, 1 deletions
diff --git a/spec/frontend/clusters_list/components/clusters_spec.js b/spec/frontend/clusters_list/components/clusters_spec.js index 3a5c4c4c008..07faee7e50b 100644 --- a/spec/frontend/clusters_list/components/clusters_spec.js +++ b/spec/frontend/clusters_list/components/clusters_spec.js @@ -14,6 +14,13 @@ describe('Clusters', () => { const endpoint = 'some/endpoint'; + const entryData = { + endpoint, + imgTagsAwsText: 'AWS Icon', + imgTagsDefaultText: 'Default Icon', + imgTagsGcpText: 'GCP Icon', + }; + const findLoader = () => wrapper.find(GlLoadingIcon); const findPaginatedButtons = () => wrapper.find(GlPagination); const findTable = () => wrapper.find(GlTable); @@ -24,7 +31,7 @@ describe('Clusters', () => { }; const mountWrapper = () => { - store = ClusterStore({ endpoint }); + store = ClusterStore(entryData); wrapper = mount(Clusters, { store }); return axios.waitForAll(); }; @@ -87,6 +94,23 @@ describe('Clusters', () => { }); }); + describe('cluster icon', () => { + it.each` + providerText | lineNumber + ${'GCP Icon'} | ${0} + ${'AWS Icon'} | ${1} + ${'Default Icon'} | ${2} + ${'Default Icon'} | ${3} + ${'Default Icon'} | ${4} + ${'Default Icon'} | ${5} + `('renders provider image and alt text for each cluster', ({ providerText, lineNumber }) => { + const images = findTable().findAll('.js-status img'); + const image = images.at(lineNumber); + + expect(image.attributes('alt')).toBe(providerText); + }); + }); + describe('cluster status', () => { it.each` statusName | lineNumber | result diff --git a/spec/frontend/clusters_list/mock_data.js b/spec/frontend/clusters_list/mock_data.js index eb8582796f7..48af3b91c94 100644 --- a/spec/frontend/clusters_list/mock_data.js +++ b/spec/frontend/clusters_list/mock_data.js @@ -3,6 +3,7 @@ export const clusterList = [ name: 'My Cluster 1', environment_scope: '*', cluster_type: 'group_type', + provider_type: 'gcp', status: 'creating', nodes: null, }, @@ -10,6 +11,7 @@ export const clusterList = [ name: 'My Cluster 2', environment_scope: 'development', cluster_type: 'project_type', + provider_type: 'aws', status: 'unreachable', nodes: [ { @@ -22,6 +24,7 @@ export const clusterList = [ name: 'My Cluster 3', environment_scope: 'development', cluster_type: 'project_type', + provider_type: 'none', status: 'authentication_failure', nodes: [ { |