Skip to content

Commit

Permalink
fix(screenshot-accepter): wrong utils import
Browse files Browse the repository at this point in the history
  • Loading branch information
sipayRT committed Oct 4, 2023
1 parent b1d06fb commit c918232
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
2 changes: 1 addition & 1 deletion lib/static/components/modals/screenshot-accepter/body.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import {connect} from 'react-redux';
import PropTypes from 'prop-types';
import ResizedScreenshot from '../../state/screenshot/resized';
import StateFail from '../../state/state-fail';
import {isNoRefImageError} from '../../../modules/utils';
import {isNoRefImageError} from '../../../../common-utils';
import ViewInBrowserIcon from '../../icons/view-in-browser';

class ScreenshotAccepterBody extends Component {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {mkConnectedComponent} from '../../utils';

describe('<ScreenshotAccepterBody/>', () => {
const sandbox = sinon.sandbox.create();
let ScreenshotAccepterBody, ResizedScreenshot, StateFail, isNoRefImageError;
let ScreenshotAccepterBody, ResizedScreenshot, StateFail;

const mkBrowser = (opts) => {
const browser = defaults(opts, {
Expand Down Expand Up @@ -56,12 +56,10 @@ describe('<ScreenshotAccepterBody/>', () => {
beforeEach(() => {
ResizedScreenshot = sandbox.stub().returns(null);
StateFail = sandbox.stub().returns(null);
isNoRefImageError = sandbox.stub().returns(false);

ScreenshotAccepterBody = proxyquire('lib/static/components/modals/screenshot-accepter/body', {
'../../state/screenshot/resized': {default: ResizedScreenshot},
'../../state/state-fail': {default: StateFail},
'../../../modules/utils': {isNoRefImageError}
'../../state/state-fail': {default: StateFail}
}).default;
});

Expand Down Expand Up @@ -97,13 +95,12 @@ describe('<ScreenshotAccepterBody/>', () => {
id: 'img',
parentId: 'res',
stateName: 'state',
error: {stack: 'NoRefImageError'},
error: {name: 'NoRefImageError'},
actualImg: {path: 'some/path', size: {width: 10, height: 20}}
});
const resultsById = mkResult({id: 'res', parentId: 'bro'});
const browsersById = mkBrowser({id: 'bro', parentId: 'suite', name: 'yabro'});
const tree = mkStateTree({browsersById, resultsById});
isNoRefImageError.withArgs(image.error).returns(true);

const component = mkBodyComponent({image}, {tree});

Expand All @@ -121,7 +118,6 @@ describe('<ScreenshotAccepterBody/>', () => {
const resultsById = mkResult({id: 'res', parentId: 'bro'});
const browsersById = mkBrowser({id: 'bro', parentId: 'suite', name: 'yabro'});
const tree = mkStateTree({browsersById, resultsById});
isNoRefImageError.returns(false);

mkBodyComponent({image}, {tree});

Expand Down

0 comments on commit c918232

Please sign in to comment.