Skip to content

Commit

Permalink
LPS-101943 Source formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
natocesarrego committed Feb 14, 2020
1 parent 28ca2ed commit bb075ca
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -94,24 +94,14 @@ class Calculator extends Component {

prepareStateForRender(state) {
const {expression} = state;
let placeholder = Liferay.Language.get(
'the-expression-will-be-displayed-here'
);

if (
typeof Liferay !== 'undefined' &&
typeof Liferay.Browser !== 'undefined'
) {
if (Liferay.Browser.isIe()) {
placeholder = '';
}
}

return {
...state,
...this.getStateBasedOnExpression(expression),
expression: expression.replace(/[[\]]/g, ''),
placeholder
placeholder: Liferay.Browser.isIe()
? ''
: Liferay.Language.get('the-expression-will-be-displayed-here')
};
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,13 @@ describe('Calculator', () => {
beforeEach(() => {
jest.useFakeTimers();

window.Liferay = {
...(window.Liferay || {}),
Browser: {
isIe: () => false
}
};

component = new Calculator(getBaseConfig());
});

Expand Down

0 comments on commit bb075ca

Please sign in to comment.