-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(confirmation, formState, app, about, masthead, redux): issues/1 (#10
) 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
Showing
34 changed files
with
753 additions
and
691 deletions.
There are no files selected for viewing
106 changes: 0 additions & 106 deletions
106
src/components/about/__tests__/__snapshots__/about.test.js.snap
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
124 changes: 124 additions & 0 deletions
124
src/components/aboutModal/__tests__/__snapshots__/aboutModal.test.js.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> | ||
`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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'); | ||
}); | ||
}); |
Oops, something went wrong.