fix e2e walkthrough test failures

pull/1671/head
Joseph Izang 3 years ago
parent 2bca2f9d11
commit a7f38cde88
  1. 8
      apps/remix-ide/src/walkthroughService.js
  2. 12
      libs/remix-ui/vertical-icons-panel/src/lib/remix-ui-vertical-icons-panel.tsx

@ -6,8 +6,8 @@ export class WalkthroughService {
} }
start (params) { start (params) {
if (!localStorage.getItem('hadTour_initial')) { document.addEventListener('doWalkThrough', (e) => {
document.addEventListener('doWalkThrough', (e) => { if (!localStorage.getItem('hadTour_initial')) {
introJs().setOptions({ introJs().setOptions({
steps: [{ steps: [{
title: 'Welcome to Remix IDE', title: 'Welcome to Remix IDE',
@ -47,8 +47,8 @@ export class WalkthroughService {
} }
}).start() }).start()
localStorage.setItem('hadTour_initial', true) localStorage.setItem('hadTour_initial', true)
}) }
} })
} }
startFeatureTour () { startFeatureTour () {

@ -4,7 +4,8 @@ import React, {
Fragment, Fragment,
useEffect, useEffect,
useReducer, useReducer,
useRef useRef,
useState
} from 'react' } from 'react'
import './remix-ui-vertical-icons-panel.css' import './remix-ui-vertical-icons-panel.css'
@ -24,7 +25,7 @@ export function RemixUiVerticalIconsPanel ({
}: RemixUiVerticalIconsPanelProps) { }: RemixUiVerticalIconsPanelProps) {
const scrollableRef = useRef<any>() const scrollableRef = useRef<any>()
const iconPanelRef = useRef<any>() const iconPanelRef = useRef<any>()
const udappPanelRef = useRef<any>() // const [first] = useState(localStorage.getItem('firstTime'))
function onThemeChanged (themeType: any) { function onThemeChanged (themeType: any) {
const invert = themeType === 'dark' ? 1 : 0 const invert = themeType === 'dark' ? 1 : 0
@ -90,12 +91,11 @@ export function RemixUiVerticalIconsPanel ({
useEffect(() => { useEffect(() => {
const found = iconPanelRef.current!.querySelector('#verticalIconsKindudapp') const found = iconPanelRef.current!.querySelector('#verticalIconsKindudapp')
if (found) { if (verticalIconsPlugin.targetProfileForChange && verticalIconsPlugin.targetProfileForChange.udapp) {
console.log('emit event now as vertical panel is in the viewport', found)
const doWalkThroughEvent = new Event('doWalkThrough') const doWalkThroughEvent = new Event('doWalkThrough')
document.dispatchEvent(doWalkThroughEvent) document.dispatchEvent(doWalkThroughEvent)
} }
}) }, [Object.keys(verticalIconsPlugin.targetProfileForChange).length])
return ( return (
<div id="iconsP" className="h-100"> <div id="iconsP" className="h-100">
@ -178,7 +178,7 @@ export function RemixUiVerticalIconsPanel ({
.map(p => ( .map(p => (
<div id="runIcons" data-id="verticalIconsKindUdapp" key={ <div id="runIcons" data-id="verticalIconsKindUdapp" key={
verticalIconsPlugin.targetProfileForChange[p].displayName verticalIconsPlugin.targetProfileForChange[p].displayName
} ref={udappPanelRef} }
> >
<Icon <Icon
kind={verticalIconsPlugin.targetProfileForChange[p].kind} kind={verticalIconsPlugin.targetProfileForChange[p].kind}

Loading…
Cancel
Save