generated from eea/volto-addon-template
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(download): implement scroll to iframes to ensure print to pdf ha…
…s preview of iframes (#213) * feat: set isPrint redux state when window.print() is triggered * add isPrint missing files * test: add Logo.test.jsx * test: fix in Logo.test.jsx * test: added HomePageView.test.jsx and HomePageInverseView.test.jsx * chore: cleanup unused RemoveSchema code * chore: cleanup unused RemoveSchema code * test: added TokenWidget.test.jsx and TopicsWidget.test.jsx * Automated release 1.28.4 * Bump version to 1.29.0 from 1.28.4 * Automated release 1.29.0 * fix: smaller timeout in window.print * test: TokenWidget.test.jsx and TopicsWidget.test.jsx cover more conditions * Automated release 1.29.0 --------- Co-authored-by: EEA Jenkins <@users.noreply.github.com> Co-authored-by: Claudia Ifrim <ifrim.claudia@gmail.com>
- Loading branch information
1 parent
f9090eb
commit bc5cbe0
Showing
16 changed files
with
345 additions
and
19 deletions.
There are no files selected for viewing
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
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
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 |
---|---|---|
@@ -1 +1 @@ | ||
export * from './schema'; | ||
export * from './print'; |
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,13 @@ | ||
/** | ||
* Print action. | ||
* @module actions/print | ||
*/ | ||
|
||
import { SET_ISPRINT } from '@eeacms/volto-eea-website-theme/constants/ActionTypes'; | ||
|
||
export const setIsPrint = (data) => { | ||
return { | ||
type: SET_ISPRINT, | ||
payload: data, | ||
}; | ||
}; |
This file was deleted.
Oops, something went wrong.
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
16 changes: 16 additions & 0 deletions
16
src/components/theme/Homepage/HomePageInverseView.test.jsx
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,16 @@ | ||
import React from 'react'; | ||
import { render } from '@testing-library/react'; | ||
import HomePageInverseView from './HomePageInverseView'; | ||
import '@testing-library/jest-dom/extend-expect'; | ||
|
||
describe('HomePageInverseView Component', () => { | ||
it('renders without crashing', () => { | ||
const mockContent = ( | ||
<body> | ||
<div>Mock content</div> | ||
</body> | ||
); | ||
const { container } = render(<HomePageInverseView content={mockContent} />); | ||
expect(container).toBeTruthy(); | ||
}); | ||
}); |
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,16 @@ | ||
import React from 'react'; | ||
import { render } from '@testing-library/react'; | ||
import HomePageView from './HomePageView'; | ||
import '@testing-library/jest-dom/extend-expect'; | ||
|
||
describe('HomePageView Component', () => { | ||
it('renders without crashing', () => { | ||
const mockContent = ( | ||
<body> | ||
<div>Mock content</div> | ||
</body> | ||
); | ||
const { container } = render(<HomePageView content={mockContent} />); | ||
expect(container).toBeTruthy(); | ||
}); | ||
}); |
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,31 @@ | ||
import React from 'react'; | ||
import { render } from '@testing-library/react'; | ||
import { Provider } from 'react-intl-redux'; | ||
import configureStore from 'redux-mock-store'; | ||
import { Router } from 'react-router-dom'; | ||
import { createMemoryHistory } from 'history'; | ||
import EEALogo from './Logo'; | ||
|
||
const mockStore = configureStore(); | ||
let history = createMemoryHistory(); | ||
|
||
describe('EEALogo Component', () => { | ||
it('renders without crashing', () => { | ||
const store = mockStore({ | ||
intl: { | ||
locale: 'en', | ||
messages: {}, | ||
}, | ||
}); | ||
|
||
const { container } = render( | ||
<Provider store={store}> | ||
<Router history={history}> | ||
<EEALogo /> | ||
</Router> | ||
</Provider>, | ||
); | ||
|
||
expect(container).toBeTruthy(); | ||
}); | ||
}); |
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,54 @@ | ||
import React from 'react'; | ||
import { render } from '@testing-library/react'; | ||
import { Provider } from 'react-intl-redux'; | ||
import configureStore from 'redux-mock-store'; | ||
import { Router } from 'react-router-dom'; | ||
import { createMemoryHistory } from 'history'; | ||
import { TokenWidget } from './TokenWidget'; | ||
|
||
const mockStore = configureStore(); | ||
let history = createMemoryHistory(); | ||
|
||
describe('TokenWidget Component', () => { | ||
it('renders without crashing', () => { | ||
const store = mockStore({ | ||
intl: { | ||
locale: 'en', | ||
messages: {}, | ||
}, | ||
}); | ||
|
||
const { container } = render( | ||
<Provider store={store}> | ||
<Router history={history}> | ||
<TokenWidget | ||
value={['Value1', 'Value2']} | ||
children={''} | ||
className={'test'} | ||
/> | ||
</Router> | ||
</Provider>, | ||
); | ||
|
||
expect(container).toBeTruthy(); | ||
}); | ||
|
||
it('renders without crashing, without value', () => { | ||
const store = mockStore({ | ||
intl: { | ||
locale: 'en', | ||
messages: {}, | ||
}, | ||
}); | ||
|
||
const { container } = render( | ||
<Provider store={store}> | ||
<Router history={history}> | ||
<TokenWidget value={null} children={''} className={'test'} /> | ||
</Router> | ||
</Provider>, | ||
); | ||
|
||
expect(container).toBeTruthy(); | ||
}); | ||
}); |
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,54 @@ | ||
import React from 'react'; | ||
import { render } from '@testing-library/react'; | ||
import { Provider } from 'react-intl-redux'; | ||
import configureStore from 'redux-mock-store'; | ||
import { Router } from 'react-router-dom'; | ||
import { createMemoryHistory } from 'history'; | ||
import { TopicsWidget } from './TopicsWidget'; | ||
|
||
const mockStore = configureStore(); | ||
let history = createMemoryHistory(); | ||
|
||
describe('TopicsWidget Component', () => { | ||
it('renders without crashing, with value', () => { | ||
const store = mockStore({ | ||
intl: { | ||
locale: 'en', | ||
messages: {}, | ||
}, | ||
}); | ||
|
||
const { container } = render( | ||
<Provider store={store}> | ||
<Router history={history}> | ||
<TopicsWidget | ||
value={['Value1', 'Value2']} | ||
children={''} | ||
className={'test'} | ||
/> | ||
</Router> | ||
</Provider>, | ||
); | ||
|
||
expect(container).toBeTruthy(); | ||
}); | ||
|
||
it('renders without crashing, without value', () => { | ||
const store = mockStore({ | ||
intl: { | ||
locale: 'en', | ||
messages: {}, | ||
}, | ||
}); | ||
|
||
const { container } = render( | ||
<Provider store={store}> | ||
<Router history={history}> | ||
<TopicsWidget value={null} children={''} className={'test'} /> | ||
</Router> | ||
</Provider>, | ||
); | ||
|
||
expect(container).toBeTruthy(); | ||
}); | ||
}); |
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,6 @@ | ||
/** | ||
* Action types. | ||
* @module constants/ActionTypes | ||
*/ | ||
|
||
export const SET_ISPRINT = 'SET_ISPRINT'; |
Oops, something went wrong.