diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-11-17 15:09:15 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-11-17 15:09:15 +0300 |
commit | 9a8f801d7352b7965fe690a599410fb50005ce67 (patch) | |
tree | 1e6b3f942dd7ab1f35311b021d181f8e7b14ec7e /spec/frontend | |
parent | 6fa3630aad333511c687b385c2333e98e09595b4 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/frontend')
3 files changed, 38 insertions, 21 deletions
diff --git a/spec/frontend/alerts_settings/__snapshots__/alerts_settings_form_new_spec.js.snap b/spec/frontend/alerts_settings/__snapshots__/alerts_settings_form_new_spec.js.snap index 815aa430d87..e2ef7483316 100644 --- a/spec/frontend/alerts_settings/__snapshots__/alerts_settings_form_new_spec.js.snap +++ b/spec/frontend/alerts_settings/__snapshots__/alerts_settings_form_new_spec.js.snap @@ -1,39 +1,38 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`AlertsSettingsFormNew with default values renders the initial template 1`] = ` -"<form class=\\"gl-mt-6\\" canmanageopsgenie=\\"true\\"> +"<form class=\\"gl-mt-6\\"> <h5 class=\\"gl-font-lg gl-my-5\\">Add new integrations</h5> <div id=\\"integration-type\\" role=\\"group\\" class=\\"form-group gl-form-group\\"><label id=\\"integration-type__BV_label_\\" for=\\"integration-type\\" class=\\"d-block col-form-label\\">1. Select integration type</label> <div class=\\"bv-no-focus-ring\\"><select class=\\"gl-form-select custom-select\\" id=\\"__BVID__8\\"> <option value=\\"\\">Select integration type</option> <option value=\\"HTTP\\">HTTP Endpoint</option> <option value=\\"PROMETHEUS\\">External Prometheus</option> - <option disabled=\\"disabled\\" value=\\"OPSGENIE\\">Opsgenie</option> + <option value=\\"OPSGENIE\\">Opsgenie</option> </select> - <div class=\\"gl-my-4\\"><span class=\\"gl-text-gray-500\\">Learn more about our upcoming <a rel=\\"noopener noreferrer\\" target=\\"_blank\\" href=\\"https://gitlab.com/groups/gitlab-org/-/epics/4390\\" class=\\"gl-link gl-display-inline-block\\">integrations</a></span></div> <!----> <!----> <!----> <!----> </div> </div> - <div class=\\"gl-mt-3 collapse\\" style=\\"display: none;\\" id=\\"__BVID__13\\"> + <div class=\\"gl-mt-3 collapse\\" style=\\"display: none;\\" id=\\"__BVID__10\\"> <div> <div id=\\"name-integration\\" role=\\"group\\" class=\\"form-group gl-form-group\\"><label id=\\"name-integration__BV_label_\\" for=\\"name-integration\\" class=\\"d-block col-form-label\\">2. Name integration</label> - <div class=\\"bv-no-focus-ring\\"><input type=\\"text\\" placeholder=\\"Enter integration name\\" class=\\"gl-form-input form-control\\" id=\\"__BVID__18\\"> + <div class=\\"bv-no-focus-ring\\"><input type=\\"text\\" placeholder=\\"Enter integration name\\" class=\\"gl-form-input form-control\\" id=\\"__BVID__15\\"> <!----> <!----> <!----> </div> </div> <div id=\\"integration-webhook\\" role=\\"group\\" class=\\"form-group gl-form-group\\"><label id=\\"integration-webhook__BV_label_\\" for=\\"integration-webhook\\" class=\\"d-block col-form-label\\">3. Set up webhook</label> - <div class=\\"bv-no-focus-ring\\"><span class=\\"gl-text-gray-500\\">Utilize the URL and authorization key below to authorize an external service to send Alerts to GitLab. Review your chosen services documentation to learn where to add these details, and the <a rel=\\"noopener noreferrer\\" target=\\"_blank\\" href=\\"https://docs.gitlab.com/ee/operations/incident_management/alert_integrations.html\\" class=\\"gl-link gl-display-inline-block\\">GitLab documentation</a> to learn more about configuring your endpoint.</span> <label class=\\"gl-display-flex gl-flex-direction-column gl-mb-0 gl-w-max-content gl-my-4 gl-font-weight-normal\\"> + <div class=\\"bv-no-focus-ring\\"><span>Utilize the URL and authorization key below to authorize an external service to send alerts to GitLab. Review your external service's documentation to learn where to add these details, and the <a rel=\\"noopener noreferrer\\" target=\\"_blank\\" href=\\"https://docs.gitlab.com/ee/operations/incident_management/alert_integrations.html\\" class=\\"gl-link gl-display-inline-block\\">GitLab documentation</a> to learn more about configuring your endpoint.</span> <label class=\\"gl-display-flex gl-flex-direction-column gl-mb-0 gl-w-max-content gl-my-4 gl-font-weight-normal\\"> <div class=\\"gl-toggle-wrapper\\"><span class=\\"gl-toggle-label\\">Active</span> <!----> <button aria-label=\\"Active\\" type=\\"button\\" class=\\"gl-toggle\\"><span class=\\"toggle-icon\\"><svg data-testid=\\"close-icon\\" class=\\"gl-icon s16\\"><use href=\\"#close\\"></use></svg></span></button></div> <!----> </label> <!----> - <div class=\\"gl-my-4\\"><span> + <div class=\\"gl-my-4\\"><span class=\\"gl-font-weight-bold\\"> Webhook URL </span> <div id=\\"url\\" readonly=\\"readonly\\"> @@ -49,10 +48,10 @@ exports[`AlertsSettingsFormNew with default values renders the initial template </div> </div> </div> - <div class=\\"gl-my-4\\"><span> + <div class=\\"gl-my-4\\"><span class=\\"gl-font-weight-bold\\"> Authorization key </span> - <div id=\\"authorization-key\\" readonly=\\"readonly\\" class=\\"gl-mb-2\\"> + <div id=\\"authorization-key\\" readonly=\\"readonly\\" class=\\"gl-mb-3\\"> <div role=\\"group\\" class=\\"input-group\\"> <!----> <!----> <input id=\\"authorization-key\\" type=\\"text\\" readonly=\\"readonly\\" class=\\"gl-form-input form-control\\"> @@ -63,7 +62,7 @@ exports[`AlertsSettingsFormNew with default values renders the initial template <!----></button></div> <!----> </div> - </div> <button type=\\"button\\" disabled=\\"disabled\\" class=\\"btn gl-mt-3 btn-default btn-md disabled gl-button\\"> + </div> <button type=\\"button\\" disabled=\\"disabled\\" class=\\"btn btn-default btn-md disabled gl-button\\"> <!----> <!----> <span class=\\"gl-button-text\\"> Reset Key @@ -75,8 +74,8 @@ exports[`AlertsSettingsFormNew with default values renders the initial template <!----> </div> </div> - <div id=\\"test-integration\\" role=\\"group\\" class=\\"form-group gl-form-group\\"><label id=\\"test-integration__BV_label_\\" for=\\"test-integration\\" class=\\"d-block col-form-label\\">4. Test integration(optional)</label> - <div class=\\"bv-no-focus-ring\\"><span class=\\"gl-text-gray-500\\">Provide an example payload from the monitoring tool you intend to integrate with to send a test alert to the <a rel=\\"noopener noreferrer\\" target=\\"_blank\\" href=\\"http://invalid\\" class=\\"gl-link gl-display-inline-block\\">alerts page</a>. This payload can be used to test the integration using the \\"save and test payload\\" button.</span> <textarea id=\\"test-payload\\" disabled=\\"disabled\\" placeholder=\\"Enter test alert JSON....\\" wrap=\\"soft\\" class=\\"gl-form-input gl-form-textarea gl-my-4 form-control is-valid\\" style=\\"resize: none; overflow-y: scroll;\\"></textarea> + <div id=\\"test-integration\\" role=\\"group\\" class=\\"form-group gl-form-group\\"><label id=\\"test-integration__BV_label_\\" for=\\"test-integration\\" class=\\"d-block col-form-label\\">4. Sample alert payload (optional)</label> + <div class=\\"bv-no-focus-ring\\"><span>Provide an example payload from the monitoring tool you intend to integrate with. This payload can be used to test the integration (optional).</span> <textarea id=\\"test-payload\\" disabled=\\"disabled\\" placeholder=\\"{ "events": [{ "application": "Name of application" }] }\\" wrap=\\"soft\\" class=\\"gl-form-input gl-form-textarea gl-my-3 form-control is-valid\\" style=\\"resize: none; overflow-y: scroll;\\"></textarea> <!----> <!----> <!----> @@ -85,14 +84,14 @@ exports[`AlertsSettingsFormNew with default values renders the initial template <!----> <!----> </div> - <div class=\\"gl-display-flex gl-justify-content-end\\"><button type=\\"reset\\" class=\\"btn gl-mr-3 js-no-auto-disable btn-default btn-md gl-button\\"> + <div class=\\"gl-display-flex gl-justify-content-start gl-py-3\\"><button data-testid=\\"integration-form-submit\\" type=\\"submit\\" class=\\"btn js-no-auto-disable btn-success btn-md gl-button\\"> <!----> - <!----> <span class=\\"gl-button-text\\">Cancel</span></button> <button data-testid=\\"integration-test-and-submit\\" type=\\"button\\" class=\\"btn gl-mr-1 js-no-auto-disable btn-success btn-md gl-button btn-success-secondary\\"> + <!----> <span class=\\"gl-button-text\\">Save integration + </span></button> <button data-testid=\\"integration-test-and-submit\\" type=\\"button\\" class=\\"btn gl-mx-3 js-no-auto-disable btn-success btn-md gl-button btn-success-secondary\\"> <!----> - <!----> <span class=\\"gl-button-text\\">Save and test payload</span></button> <button data-testid=\\"integration-form-submit\\" type=\\"submit\\" class=\\"btn js-no-auto-disable btn-success btn-md gl-button\\"> + <!----> <span class=\\"gl-button-text\\">Save and test payload</span></button> <button type=\\"reset\\" class=\\"btn js-no-auto-disable btn-default btn-md gl-button\\"> <!----> - <!----> <span class=\\"gl-button-text\\">Save integration - </span></button></div> + <!----> <span class=\\"gl-button-text\\">Cancel</span></button></div> </div> </form>" `; diff --git a/spec/frontend/jobs/components/log/line_spec.js b/spec/frontend/jobs/components/log/line_spec.js index 6154dbbdcc2..314b23ec29b 100644 --- a/spec/frontend/jobs/components/log/line_spec.js +++ b/spec/frontend/jobs/components/log/line_spec.js @@ -131,6 +131,12 @@ describe('Job Log Line', () => { expect(findLink().attributes().rel).toBe('nofollow noopener noreferrer'); }); + it('renders a link with corresponding styles', () => { + createComponent(mockProps({ text: httpsUrl })); + + expect(findLink().classes()).toEqual(['gl-reset-color!', 'gl-text-decoration-underline']); + }); + it('render links surrounded by text', () => { createComponent( mockProps({ text: `My HTTP url: ${httpUrl} and my HTTPS url: ${httpsUrl} are here.` }), diff --git a/spec/frontend/terraform/components/states_table_spec.js b/spec/frontend/terraform/components/states_table_spec.js index e2c2660b221..7a8cb19971e 100644 --- a/spec/frontend/terraform/components/states_table_spec.js +++ b/spec/frontend/terraform/components/states_table_spec.js @@ -39,6 +39,16 @@ describe('StatesTable', () => { }, }, }, + { + name: 'state-4', + lockedAt: '2020-10-10T00:00:00Z', + lockedByUser: null, + updatedAt: '2020-10-10T00:00:00Z', + latestVersion: { + updatedAt: '2020-10-09T00:00:00Z', + createdByUser: null, + }, + }, ], }; @@ -53,10 +63,11 @@ describe('StatesTable', () => { }); it.each` - name | toolTipText | locked | lineNumber - ${'state-1'} | ${'Locked by user-1 2 days ago'} | ${true} | ${0} - ${'state-2'} | ${null} | ${false} | ${1} - ${'state-3'} | ${'Locked by user-2 5 days ago'} | ${true} | ${2} + name | toolTipText | locked | lineNumber + ${'state-1'} | ${'Locked by user-1 2 days ago'} | ${true} | ${0} + ${'state-2'} | ${null} | ${false} | ${1} + ${'state-3'} | ${'Locked by user-2 5 days ago'} | ${true} | ${2} + ${'state-4'} | ${'Locked by Unknown User 5 days ago'} | ${true} | ${3} `( 'displays the name and locked information "$name" for line "$lineNumber"', ({ name, toolTipText, locked, lineNumber }) => { @@ -80,6 +91,7 @@ describe('StatesTable', () => { ${'updated 2 days ago'} | ${0} ${'updated 5 days ago'} | ${1} ${'user-3 updated 4 days ago'} | ${2} + ${'updated 6 days ago'} | ${3} `('displays the time "$updateTime" for line "$lineNumber"', ({ updateTime, lineNumber }) => { const states = wrapper.findAll('[data-testid="terraform-states-table-updated"]'); |