mirror of
https://github.com/empayre/fleet.git
synced 2024-11-07 09:18:59 +00:00
ac9a38c207
* 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
36 lines
1.0 KiB
JavaScript
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',
|
|
});
|
|
});
|
|
});
|