mirror of
https://github.com/scratchfoundation/scratch-paint.git
synced 2024-12-22 21:42:30 -05:00
Fix tests
This commit is contained in:
parent
0529c43c25
commit
2b267ba6e9
3 changed files with 4 additions and 3 deletions
|
@ -254,6 +254,7 @@ class PaperCanvas extends React.Component {
|
||||||
|
|
||||||
PaperCanvas.propTypes = {
|
PaperCanvas.propTypes = {
|
||||||
canvasRef: PropTypes.func,
|
canvasRef: PropTypes.func,
|
||||||
|
changeFormat: PropTypes.func.isRequired,
|
||||||
clearHoveredItem: PropTypes.func.isRequired,
|
clearHoveredItem: PropTypes.func.isRequired,
|
||||||
clearPasteOffset: PropTypes.func.isRequired,
|
clearPasteOffset: PropTypes.func.isRequired,
|
||||||
clearSelectedItems: PropTypes.func.isRequired,
|
clearSelectedItems: PropTypes.func.isRequired,
|
||||||
|
|
|
@ -9,7 +9,7 @@ import log from '../log/log';
|
||||||
/**
|
/**
|
||||||
* Take an undo snapshot
|
* Take an undo snapshot
|
||||||
* @param {function} dispatchPerformSnapshot Callback to dispatch a state update
|
* @param {function} dispatchPerformSnapshot Callback to dispatch a state update
|
||||||
* @param {Formats} either bitmap or vector
|
* @param {Formats} format Either Formats.BITMAP or Formats.VECTOR
|
||||||
*/
|
*/
|
||||||
const performSnapshot = function (dispatchPerformSnapshot, format) {
|
const performSnapshot = function (dispatchPerformSnapshot, format) {
|
||||||
const guideLayers = hideGuideLayers();
|
const guideLayers = hideGuideLayers();
|
||||||
|
|
|
@ -23,9 +23,9 @@ test('undoRedoChangeFormat', () => {
|
||||||
let reduxState = reducer(defaultState /* state */, changeFormat(Formats.BITMAP) /* action */);
|
let reduxState = reducer(defaultState /* state */, changeFormat(Formats.BITMAP) /* action */);
|
||||||
expect(reduxState).toBe(Formats.BITMAP);
|
expect(reduxState).toBe(Formats.BITMAP);
|
||||||
reduxState = reducer(reduxState /* state */, undo(Formats.UNDO_BITMAP) /* action */);
|
reduxState = reducer(reduxState /* state */, undo(Formats.UNDO_BITMAP) /* action */);
|
||||||
expect().toBe(Formats.UNDO_BITMAP);
|
expect(reduxState).toBe(Formats.UNDO_BITMAP);
|
||||||
reduxState = reducer(reduxState /* state */, redo(Formats.UNDO_VECTOR) /* action */);
|
reduxState = reducer(reduxState /* state */, redo(Formats.UNDO_VECTOR) /* action */);
|
||||||
expect().toBe(Formats.UNDO_VECTOR);
|
expect(reduxState).toBe(Formats.UNDO_VECTOR);
|
||||||
});
|
});
|
||||||
|
|
||||||
test('invalidChangeMode', () => {
|
test('invalidChangeMode', () => {
|
||||||
|
|
Loading…
Reference in a new issue