fleet/frontend/components/icons/svg/base.tests.jsx
Mike Stone ac9a38c207 Login page scaffolding (#142)
* LoginPage component and route

* animated SVG background image utility

* Kolide text, User, Lock, & Kolide logo SVG icons

* styleguide

* Adds global footer

* Adds InputFieldWithIcon component

* Adds LoginForm component

* Render LoginForm from the LoginPage
2016-09-12 11:14:07 -04:00

36 lines
1.0 KiB
JavaScript

import React from 'react';
import expect from 'expect';
import { mount } from 'enzyme';
import base from './base';
import { KolideLoginBackground } from './KolideLoginBackground/KolideLoginBackground.svg.jsx';
describe('base - svg HOC', () => {
const WrappedComponent = base(KolideLoginBackground);
const mountedComponent = mount(
<WrappedComponent alt="image alt" fakeProp="fake" name="component name" />
);
it('renders a wrapped component', () => {
expect(mountedComponent).toExist();
});
it('filters out unwanted props', () => {
expect(mountedComponent.find(KolideLoginBackground).props()).toEqual({
alt: 'image alt',
name: 'component name',
variant: 'default',
});
});
it('allows overriding the default variant prop', () => {
const Component = base(KolideLoginBackground);
const mounted = mount(
<Component variant="my variant" />
);
expect(mounted.find(KolideLoginBackground).props()).toContain({
variant: 'my variant',
});
});
});