summaryrefslogtreecommitdiff
path: root/spec/frontend/packages/details/components/npm_installation_spec.js
diff options
context:
space:
mode:
Diffstat (limited to 'spec/frontend/packages/details/components/npm_installation_spec.js')
-rw-r--r--spec/frontend/packages/details/components/npm_installation_spec.js14
1 files changed, 13 insertions, 1 deletions
diff --git a/spec/frontend/packages/details/components/npm_installation_spec.js b/spec/frontend/packages/details/components/npm_installation_spec.js
index df820e7e948..09afcd4fd0a 100644
--- a/spec/frontend/packages/details/components/npm_installation_spec.js
+++ b/spec/frontend/packages/details/components/npm_installation_spec.js
@@ -2,6 +2,7 @@ import { shallowMount, createLocalVue } from '@vue/test-utils';
import Vuex from 'vuex';
import { registryUrl as nugetPath } from 'jest/packages/details/mock_data';
import { npmPackage as packageEntity } from 'jest/packages/mock_data';
+import InstallationTitle from '~/packages/details/components/installation_title.vue';
import NpmInstallation from '~/packages/details/components/npm_installation.vue';
import { TrackingActions } from '~/packages/details/constants';
import { npmInstallationCommand, npmSetupCommand } from '~/packages/details/store/getters';
@@ -14,6 +15,7 @@ describe('NpmInstallation', () => {
let wrapper;
const findCodeInstructions = () => wrapper.findAll(CodeInstructions);
+ const findInstallationTitle = () => wrapper.findComponent(InstallationTitle);
function createComponent() {
const store = new Vuex.Store({
@@ -38,13 +40,23 @@ describe('NpmInstallation', () => {
});
afterEach(() => {
- if (wrapper) wrapper.destroy();
+ wrapper.destroy();
});
it('renders all the messages', () => {
expect(wrapper.element).toMatchSnapshot();
});
+ describe('install command switch', () => {
+ it('has the installation title component', () => {
+ expect(findInstallationTitle().exists()).toBe(true);
+ expect(findInstallationTitle().props()).toMatchObject({
+ packageType: 'npm',
+ options: [{ value: 'npm', label: 'Show NPM commands' }],
+ });
+ });
+ });
+
describe('installation commands', () => {
it('renders the correct npm command', () => {
expect(findCodeInstructions().at(0).props()).toMatchObject({