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/jira_connect/components/app_spec.js')
-rw-r--r--spec/frontend/jira_connect/components/app_spec.js30
1 files changed, 9 insertions, 21 deletions
diff --git a/spec/frontend/jira_connect/components/app_spec.js b/spec/frontend/jira_connect/components/app_spec.js
index e2a5cd1be9d..e0d61d8209b 100644
--- a/spec/frontend/jira_connect/components/app_spec.js
+++ b/spec/frontend/jira_connect/components/app_spec.js
@@ -1,50 +1,39 @@
import { GlAlert, GlButton, GlModal, GlLink } from '@gitlab/ui';
import { mount, shallowMount } from '@vue/test-utils';
-import { extendedWrapper } from 'helpers/vue_test_utils_helper';
import JiraConnectApp from '~/jira_connect/components/app.vue';
import createStore from '~/jira_connect/store';
import { SET_ALERT } from '~/jira_connect/store/mutation_types';
-import { persistAlert } from '~/jira_connect/utils';
import { __ } from '~/locale';
-jest.mock('~/jira_connect/api');
+jest.mock('~/jira_connect/utils', () => ({
+ retrieveAlert: jest.fn().mockReturnValue({ message: 'error message' }),
+ getLocation: jest.fn(),
+}));
describe('JiraConnectApp', () => {
let wrapper;
let store;
const findAlert = () => wrapper.findComponent(GlAlert);
- const findAlertLink = () => findAlert().find(GlLink);
+ const findAlertLink = () => findAlert().findComponent(GlLink);
const findGlButton = () => wrapper.findComponent(GlButton);
const findGlModal = () => wrapper.findComponent(GlModal);
- const findHeader = () => wrapper.findByTestId('new-jira-connect-ui-heading');
- const findHeaderText = () => findHeader().text();
const createComponent = ({ provide, mountFn = shallowMount } = {}) => {
store = createStore();
- wrapper = extendedWrapper(
- mountFn(JiraConnectApp, {
- store,
- provide,
- }),
- );
+ wrapper = mountFn(JiraConnectApp, {
+ store,
+ provide,
+ });
};
afterEach(() => {
wrapper.destroy();
- wrapper = null;
});
describe('template', () => {
- it('renders new UI', () => {
- createComponent();
-
- expect(findHeader().exists()).toBe(true);
- expect(findHeaderText()).toBe('Linked namespaces');
- });
-
describe('when user is not logged in', () => {
beforeEach(() => {
createComponent({
@@ -128,7 +117,6 @@ describe('JiraConnectApp', () => {
describe('when alert is set in localStoage', () => {
it('renders alert on mount', () => {
- persistAlert({ message: 'error message' });
createComponent();
const alert = findAlert();