New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@govuk-frederic/header-button

Package Overview
Dependencies
Maintainers
4
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@govuk-frederic/header-button - npm Package Compare versions

Comparing version 0.0.4 to 0.1.0

5

es/index.js

@@ -90,8 +90,3 @@ import React from 'react';

HeaderButton.propTypes = process.env.NODE_ENV !== "production" ? {
active: PropTypes.bool,
children: PropTypes.node,
disabled: PropTypes.bool
} : {};
export default HeaderButton;
//# sourceMappingURL=index.js.map

17

es/test.js
import React from 'react';
import { shallow } from 'enzyme';
import { mount, shallow } from 'enzyme';
import { createMatchers } from 'jest-emotion';
import * as emotion from 'emotion';
import { LINK_COLOUR } from 'govuk-colours';
import Component from '.';
import HeaderButton from '.';
expect.extend(createMatchers(emotion));
describe('HeaderButton', function () {
var wrapper;
it('renders with no properties', function () {
wrapper = shallow(React.createElement(Component, null));
it('renders without crashing', function () {
var wrapper = shallow(React.createElement(HeaderButton, null));
expect(wrapper.exists()).toBe(true);
});
it('applies styles on active prop', function () {
wrapper = shallow(React.createElement(Component, {
var wrapper = shallow(React.createElement(HeaderButton, {
active: true

@@ -22,3 +22,3 @@ })).find('Button');

it('applies styles on disabled prop', function () {
wrapper = shallow(React.createElement(Component, {
var wrapper = shallow(React.createElement(HeaderButton, {
disabled: true

@@ -29,2 +29,5 @@ })).find('Button');

it('matches snapshot', function () {
var wrapper = mount(React.createElement(HeaderButton, {
active: true
}));
expect(wrapper).toMatchSnapshot();

@@ -31,0 +34,0 @@ });

@@ -102,7 +102,2 @@ "use strict";

HeaderButton.propTypes = process.env.NODE_ENV !== "production" ? {
active: _propTypes.default.bool,
children: _propTypes.default.node,
disabled: _propTypes.default.bool
} : {};
var _default = HeaderButton;

@@ -109,0 +104,0 @@ exports.default = _default;

@@ -21,8 +21,8 @@ "use strict";

describe('HeaderButton', function () {
var wrapper;
it('renders with no properties', function () {
wrapper = (0, _enzyme.shallow)(_react.default.createElement(_.default, null));
it('renders without crashing', function () {
var wrapper = (0, _enzyme.shallow)(_react.default.createElement(_.default, null));
expect(wrapper.exists()).toBe(true);
});
it('applies styles on active prop', function () {
wrapper = (0, _enzyme.shallow)(_react.default.createElement(_.default, {
var wrapper = (0, _enzyme.shallow)(_react.default.createElement(_.default, {
active: true

@@ -35,3 +35,3 @@ })).find('Button');

it('applies styles on disabled prop', function () {
wrapper = (0, _enzyme.shallow)(_react.default.createElement(_.default, {
var wrapper = (0, _enzyme.shallow)(_react.default.createElement(_.default, {
disabled: true

@@ -42,2 +42,5 @@ })).find('Button');

it('matches snapshot', function () {
var wrapper = (0, _enzyme.mount)(_react.default.createElement(_.default, {
active: true
}));
expect(wrapper).toMatchSnapshot();

@@ -44,0 +47,0 @@ });

{
"name": "@govuk-frederic/header-button",
"version": "0.0.4",
"version": "0.1.0",
"dependencies": {

@@ -5,0 +5,0 @@ "@govuk-react/constants": "^0.2.7",

import React from 'react';
import { shallow } from 'enzyme';
import { mount, shallow } from 'enzyme';
import { createMatchers } from 'jest-emotion';

@@ -7,3 +7,3 @@ import * as emotion from 'emotion';

import Component from '.';
import HeaderButton from '.';

@@ -13,10 +13,9 @@ expect.extend(createMatchers(emotion));

describe('HeaderButton', () => {
let wrapper;
it('renders with no properties', () => {
wrapper = shallow(<Component />);
it('renders without crashing', () => {
const wrapper = shallow(<HeaderButton />);
expect(wrapper.exists()).toBe(true);
});
it('applies styles on active prop', () => {
wrapper = shallow(<Component active />).find('Button');
const wrapper = shallow(<HeaderButton active />).find('Button');
expect(wrapper).toHaveStyleRule('border-bottom-color', LINK_COLOUR);

@@ -28,3 +27,3 @@ expect(wrapper).toHaveStyleRule('border-top-color', LINK_COLOUR);

it('applies styles on disabled prop', () => {
wrapper = shallow(<Component disabled />).find('Button');
const wrapper = shallow(<HeaderButton disabled />).find('Button');
expect(wrapper).toHaveStyleRule('opacity', '0.35');

@@ -35,4 +34,5 @@ // Can't see a way of testing pseudo-selectors here...

it('matches snapshot', () => {
const wrapper = mount(<HeaderButton active />);
expect(wrapper).toMatchSnapshot();
});
});

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc