diff --git a/src/components/RegistryInfoContent/RegistryInfoContent.test.tsx b/src/components/RegistryInfoContent/RegistryInfoContent.test.tsx new file mode 100644 index 0000000..058c27e --- /dev/null +++ b/src/components/RegistryInfoContent/RegistryInfoContent.test.tsx @@ -0,0 +1,23 @@ +import React from 'react'; +import { mount } from 'enzyme'; + +import RegistryInfoContent from './RegistryInfoContent'; + +describe(' component', () => { + test('should render the component in default state with npm tab', () => { + const wrapper = mount(); + expect(wrapper.html()).toMatchSnapshot(); + }); + + test('should render the component in default state with pnpm tab', () => { + const wrapper = mount(); + wrapper.setState({ tabPosition: 1 }); + expect(wrapper.html()).toMatchSnapshot(); + }); + + test('should render the component in default state with yarn tab', () => { + const wrapper = mount(); + wrapper.setState({ tabPosition: 2 }); + expect(wrapper.html()).toMatchSnapshot(); + }); +}); diff --git a/src/components/RegistryInfoContent/__snapshots__/RegistryInfoContent.test.tsx.snap b/src/components/RegistryInfoContent/__snapshots__/RegistryInfoContent.test.tsx.snap new file mode 100644 index 0000000..0f69ac5 --- /dev/null +++ b/src/components/RegistryInfoContent/__snapshots__/RegistryInfoContent.test.tsx.snap @@ -0,0 +1,7 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[` component should render the component in default state with npm tab 1`] = `"
npm set @registry https://registry.verdaccio.org
npm adduser --registry https://registry.verdaccio.org
npm profile set password --registry https://registry.verdaccio.org
"`; + +exports[` component should render the component in default state with pnpm tab 1`] = `"
pnpm set @registry https://registry.verdaccio.org
pnpm adduser --registry https://registry.verdaccio.org
pnpm profile set password --registry https://registry.verdaccio.org
"`; + +exports[` component should render the component in default state with yarn tab 1`] = `"
yarn config set @registry https://registry.verdaccio.org
"`;