-
Notifications
You must be signed in to change notification settings - Fork 410
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update react-pdf to 1.6.1 Closes #1533 #1555
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,7 +28,7 @@ const PrintOption = React.createClass({ | |
}; | ||
}, | ||
onChange() { | ||
this.props.onChange(this.refs.input.getInputDOMNode().checked); | ||
this.props.onChange(!this.refs.input.props.checked); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Are you inverting the value? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, the old one. |
||
}, | ||
render() { | ||
return ( | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -48,42 +48,34 @@ describe("Test the PrintPreview component", () => { | |
expect(node).toExist(); | ||
}); | ||
|
||
it('creates component and loads pdf', (done) => { | ||
const handler = (pages) => { | ||
expect(pages).toBe(10); | ||
done(); | ||
}; | ||
ReactDOM.render(<PrintPreview setPages={handler} url="base/web/client/test-resources/print.pdf"/>, document.getElementById("container")); | ||
}); | ||
|
||
it('pdf next page', (done) => { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why did you remove this test? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It was testing ReactPDF and it is no longer mockable |
||
const handler = (page) => { | ||
expect(page).toBe(2); | ||
done(); | ||
}; | ||
const cmp = ReactDOM.render(<PrintPreview pages={10} currentPage={1} setPage={handler} url="base/web/client/test-resources/print.pdf"/>, document.getElementById("container")); | ||
const cmp = ReactDOM.render(<PrintPreview pages={10} currentPage={1} setPage={handler} url=""/>, document.getElementById("container")); | ||
expect(cmp).toExist(); | ||
const node = ReactDOM.findDOMNode(cmp); | ||
ReactTestUtils.Simulate.click(node.getElementsByTagName('button')[5]); | ||
}); | ||
|
||
it('pdf last page', (done) => { | ||
const handler = (page) => { | ||
expect(page).toBe(10); | ||
expect(page).toBe(9); | ||
done(); | ||
}; | ||
const cmp = ReactDOM.render(<PrintPreview pages={10} currentPage={1} setPage={handler} url="base/web/client/test-resources/print.pdf"/>, document.getElementById("container")); | ||
const cmp = ReactDOM.render(<PrintPreview pages={10} currentPage={1} setPage={handler} url=""/>, document.getElementById("container")); | ||
expect(cmp).toExist(); | ||
const node = ReactDOM.findDOMNode(cmp); | ||
ReactTestUtils.Simulate.click(node.getElementsByTagName('button')[6]); | ||
}); | ||
|
||
it('pdf first page', (done) => { | ||
const handler = (page) => { | ||
expect(page).toBe(1); | ||
expect(page).toBe(0); | ||
done(); | ||
}; | ||
const cmp = ReactDOM.render(<PrintPreview pages={10} currentPage={10} setPage={handler} url="base/web/client/test-resources/print.pdf"/>, document.getElementById("container")); | ||
const cmp = ReactDOM.render(<PrintPreview pages={10} currentPage={10} setPage={handler} url=""/>, document.getElementById("container")); | ||
expect(cmp).toExist(); | ||
const node = ReactDOM.findDOMNode(cmp); | ||
ReactTestUtils.Simulate.click(node.getElementsByTagName('button')[3]); | ||
|
@@ -94,7 +86,7 @@ describe("Test the PrintPreview component", () => { | |
expect(page).toBe(9); | ||
done(); | ||
}; | ||
const cmp = ReactDOM.render(<PrintPreview pages={10} currentPage={10} setPage={handler} url="base/web/client/test-resources/print.pdf"/>, document.getElementById("container")); | ||
const cmp = ReactDOM.render(<PrintPreview pages={10} currentPage={10} setPage={handler} url=""/>, document.getElementById("container")); | ||
expect(cmp).toExist(); | ||
const node = ReactDOM.findDOMNode(cmp); | ||
ReactTestUtils.Simulate.click(node.getElementsByTagName('button')[4]); | ||
|
@@ -106,7 +98,7 @@ describe("Test the PrintPreview component", () => { | |
done(); | ||
}; | ||
const cmp = ReactDOM.render(<PrintPreview zoomFactor={2.0} scale={1.0} | ||
pages={10} currentPage={1} setScale={handler} url="base/web/client/test-resources/print.pdf"/>, document.getElementById("container")); | ||
pages={10} currentPage={1} setScale={handler} url=""/>, document.getElementById("container")); | ||
expect(cmp).toExist(); | ||
const node = ReactDOM.findDOMNode(cmp); | ||
ReactTestUtils.Simulate.click(node.getElementsByTagName('button')[1]); | ||
|
@@ -118,7 +110,7 @@ describe("Test the PrintPreview component", () => { | |
done(); | ||
}; | ||
const cmp = ReactDOM.render(<PrintPreview zoomFactor={2.0} scale={4.0} | ||
pages={10} currentPage={1} setScale={handler} url="base/web/client/test-resources/print.pdf"/>, document.getElementById("container")); | ||
pages={10} currentPage={1} setScale={handler} url=""/>, document.getElementById("container")); | ||
expect(cmp).toExist(); | ||
const node = ReactDOM.findDOMNode(cmp); | ||
ReactTestUtils.Simulate.click(node.getElementsByTagName('button')[2]); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is header not needed anymore?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think it ever was, header is not a property of Grid