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

success_message_spec.js « commit_sidebar « components « ide « frontend « spec - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 7bbe47d37aff3ec2d5719f1fbb311be07e8f848d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
import Vue from 'vue';
import { createComponentWithStore } from 'helpers/vue_mount_component_helper';
import successMessage from '~/ide/components/commit_sidebar/success_message.vue';
import { createStore } from '~/ide/stores';

describe('IDE commit panel successful commit state', () => {
  let vm;
  let store;

  beforeEach(() => {
    store = createStore();

    const Component = Vue.extend(successMessage);

    vm = createComponentWithStore(Component, store, {
      committedStateSvgPath: 'committed-state',
    });

    vm.$mount();
  });

  afterEach(() => {
    vm.$destroy();
  });

  it('renders last commit message when it exists', (done) => {
    vm.$store.state.lastCommitMsg = 'testing commit message';

    Vue.nextTick(() => {
      expect(vm.$el.textContent).toContain('testing commit message');

      done();
    });
  });
});