debian-mirror-gitlab/spec/frontend/ide/components/commit_sidebar/success_message_spec.js

36 lines
849 B
JavaScript
Raw Normal View History

2018-10-15 14:42:47 +05:30
import Vue from 'vue';
2021-03-08 18:12:59 +05:30
import { createComponentWithStore } from 'helpers/vue_mount_component_helper';
2018-10-15 14:42:47 +05:30
import successMessage from '~/ide/components/commit_sidebar/success_message.vue';
2021-03-11 19:13:27 +05:30
import { createStore } from '~/ide/stores';
2018-10-15 14:42:47 +05:30
describe('IDE commit panel successful commit state', () => {
let vm;
2020-10-24 23:57:45 +05:30
let store;
2018-10-15 14:42:47 +05:30
beforeEach(() => {
2020-10-24 23:57:45 +05:30
store = createStore();
2018-10-15 14:42:47 +05:30
const Component = Vue.extend(successMessage);
vm = createComponentWithStore(Component, store, {
committedStateSvgPath: 'committed-state',
});
vm.$mount();
});
afterEach(() => {
vm.$destroy();
});
2021-03-08 18:12:59 +05:30
it('renders last commit message when it exists', (done) => {
2018-10-15 14:42:47 +05:30
vm.$store.state.lastCommitMsg = 'testing commit message';
Vue.nextTick(() => {
expect(vm.$el.textContent).toContain('testing commit message');
done();
});
});
});