actually click on the button not the div

pull/2281/head
filip mertens 3 years ago committed by yann300
parent 1ad9958ab0
commit 9726ba97d3
  1. 4
      apps/remix-ide-e2e/src/tests/remixd.test.ts
  2. 7
      libs/remix-ui/static-analyser/src/lib/ErrorRenderer.tsx
  3. 2
      libs/remix-ui/static-analyser/src/lib/remix-ui-static-analyser.tsx

@ -87,8 +87,8 @@ module.exports = {
.click('#staticanalysisButton button').pause(4000) .click('#staticanalysisButton button').pause(4000)
.waitForElementPresent('#staticanalysisresult .warning', 2000, true, function () { .waitForElementPresent('#staticanalysisresult .warning', 2000, true, function () {
browser browser
.waitForElementVisible('[data-id="staticAnalysisModuleMiscellaneous1"') .waitForElementVisible('[data-id="staticAnalysisModuleMiscellaneous1Button"]')
.click('[data-id="staticAnalysisModuleMiscellaneous1"') .click('[data-id="staticAnalysisModuleMiscellaneous1Button"]')
.waitForElementVisible('.highlightLine16', 60000) .waitForElementVisible('.highlightLine16', 60000)
.getEditorValue((content) => { .getEditorValue((content) => {
browser.assert.ok(content.indexOf( browser.assert.ok(content.indexOf(

@ -4,10 +4,11 @@ interface ErrorRendererProps {
message: any; message: any;
opt: any, opt: any,
warningErrors: any warningErrors: any
editor: any editor: any,
name: string,
} }
const ErrorRenderer = ({ message, opt, editor }: ErrorRendererProps) => { const ErrorRenderer = ({ message, opt, editor, name }: ErrorRendererProps) => {
const getPositionDetails = (msg: any) => { const getPositionDetails = (msg: any) => {
const result = { } as Record<string, number | string> const result = { } as Record<string, number | string>
@ -48,7 +49,7 @@ const ErrorRenderer = ({ message, opt, editor }: ErrorRendererProps) => {
<div className="close" data-id="renderer"> <div className="close" data-id="renderer">
<i className="fas fa-times"></i> <i className="fas fa-times"></i>
</div> </div>
<span className='d-flex flex-column' onClick={() => handlePointToErrorOnClick(opt.location, opt.fileName)}> <span className='d-flex flex-column' data-id={`${name}Button`} onClick={async () => await handlePointToErrorOnClick(opt.location, opt.fileName)}>
<span className='h6 font-weight-bold'>{opt.name}</span> <span className='h6 font-weight-bold'>{opt.name}</span>
{ opt.item.warning } { opt.item.warning }
{opt.item.more {opt.item.more

@ -539,7 +539,7 @@ export const RemixUiStaticAnalyser = (props: RemixUiStaticAnalyserProps) => {
{element[1]['map']((x, i) => ( // eslint-disable-line dot-notation {element[1]['map']((x, i) => ( // eslint-disable-line dot-notation
x.hasWarning ? ( // eslint-disable-next-line dot-notation x.hasWarning ? ( // eslint-disable-next-line dot-notation
<div data-id={`staticAnalysisModule${x.warningModuleName}${i}`} id={`staticAnalysisModule${x.warningModuleName}${i}`} key={i}> <div data-id={`staticAnalysisModule${x.warningModuleName}${i}`} id={`staticAnalysisModule${x.warningModuleName}${i}`} key={i}>
<ErrorRenderer message={x.msg} opt={x.options} warningErrors={ x.warningErrors} editor={props.analysisModule}/> <ErrorRenderer name={`staticAnalysisModule${x.warningModuleName}${i}`} message={x.msg} opt={x.options} warningErrors={ x.warningErrors} editor={props.analysisModule}/>
</div> </div>
) : null ) : null

Loading…
Cancel
Save