Skip to content

Commit

Permalink
fix(confirmation, formState, app, about, masthead, redux): issues/1 (#10
Browse files Browse the repository at this point in the history
)

Support updates for
* confirmationModal, component switched from modal to messageDialog
* confirmationModal, unit tests, styles updated, cleaned up
* formState, correction to isValid check
* app, remove aboutModal and support methods, update auth logic
* app styles, fadein support styling for component transitions
* aboutModal, convert to connected redux state
* mastheadOptions, props update related to auth logic
* redux, actions, reducers, constants updated user and status trees
* apiConstants, user and status
  • Loading branch information
cdcabrera authored Mar 15, 2019
1 parent 7c2328e commit 496df34
Show file tree
Hide file tree
Showing 34 changed files with 753 additions and 691 deletions.
106 changes: 0 additions & 106 deletions src/components/about/__tests__/__snapshots__/about.test.js.snap

This file was deleted.

18 changes: 0 additions & 18 deletions src/components/about/__tests__/about.test.js

This file was deleted.

60 changes: 0 additions & 60 deletions src/components/about/about.js

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`AboutModal Component should contain brand: brand 1`] = `
<AboutModal
altLogo="RH ER"
className=""
logo="logo-brand.svg"
onHide={[Function]}
productTitle={
<img
alt="Red Hat Entitlements Reporting"
src="title-brand.svg"
/>
}
show={true}
trademarkText="Copyright (c) 2019 Red Hat Inc."
>
<AboutModalVersions
className=""
>
<AboutModalVersionItem
className=""
label="Version"
versionText="unknown (Build: unknown)"
/>
</AboutModalVersions>
</AboutModal>
`;

exports[`AboutModal Component should render a connected component with default props: connected 1`] = `
<AboutModal
apiVersion={1}
brand={false}
build={null}
getStatus={[Function]}
getUser={[Function]}
show={true}
username="lorem"
/>
`;

exports[`AboutModal Component should render a non-connected component: hidden modal 1`] = `
<AboutModal
apiVersion={1}
brand={false}
build={null}
getStatus={[Function]}
getUser={[Function]}
show={false}
username="admin"
>
<AboutModal
altLogo="ER"
className=""
logo="logo.svg"
onHide={[Function]}
productTitle={
<img
alt="Entitlements Reporting"
src="title.svg"
/>
}
show={false}
trademarkText=""
>
<Modal
animation={true}
autoFocus={true}
backdrop={true}
bsClass="modal"
className=""
contentClassName="about-modal-pf"
dialogComponentClass={[Function]}
enforceFocus={true}
keyboard={true}
manager={
ModalManager {
"add": [Function],
"containers": Array [],
"data": Array [],
"handleContainerOverflow": true,
"hideSiblingNodes": true,
"isTopModal": [Function],
"modals": Array [],
"remove": [Function],
}
}
onHide={[Function]}
renderBackdrop={[Function]}
restoreFocus={true}
show={false}
>
<Modal
autoFocus={true}
backdrop={true}
backdropClassName="modal-backdrop"
backdropTransition={[Function]}
containerClassName="modal-open"
enforceFocus={true}
keyboard={true}
manager={
ModalManager {
"add": [Function],
"containers": Array [],
"data": Array [],
"handleContainerOverflow": true,
"hideSiblingNodes": true,
"isTopModal": [Function],
"modals": Array [],
"remove": [Function],
}
}
onEntering={[Function]}
onExited={[Function]}
onHide={[Function]}
renderBackdrop={[Function]}
restoreFocus={true}
show={false}
transition={[Function]}
/>
</Modal>
</AboutModal>
</AboutModal>
`;
40 changes: 40 additions & 0 deletions src/components/aboutModal/__tests__/aboutModal.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
import React from 'react';
import configureMockStore from 'redux-mock-store';
import { mount, shallow } from 'enzyme';
import { ConnectedAboutModal, AboutModal } from '../aboutModal';

describe('AboutModal Component', () => {
const generateEmptyStore = (obj = {}) => configureMockStore()(obj);

it('should render a connected component with default props', () => {
const store = generateEmptyStore({
aboutModal: { show: true },
user: { session: { username: 'lorem' } },
status: { apiVersion: 1 }
});
const component = shallow(<ConnectedAboutModal />, { context: { store } });

expect(component).toMatchSnapshot('connected');
});

it('should render a non-connected component', () => {
const props = {
show: false,
apiVersion: 1,
username: 'admin'
};

const component = mount(<AboutModal {...props} />);
expect(component).toMatchSnapshot('hidden modal');
});

it('should contain brand', () => {
const props = {
show: true,
brand: true
};

const component = shallow(<AboutModal {...props} />);
expect(component).toMatchSnapshot('brand');
});
});
Loading

0 comments on commit 496df34

Please sign in to comment.