Chore/setup testing environment (#755)

* chore: setup environment for unit tests

* fix: remove extra character from json
This commit is contained in:
Vardan Hakobyan
2021-11-30 19:01:51 +04:00
committed by GitHub
parent b5e89f461e
commit a8f949e8c5
6 changed files with 2233 additions and 57 deletions

View File

@@ -45,7 +45,7 @@ export const ComponentView: FunctionalComponent<IProps> = observer(
const [isIssueOnLoading, setIsIssueOnLoading] = useState(false);
const [isLoading, setIsLoading] = useState(false);
const [isReloading, setIsReloading] = useState(false);
const [loadTimeout, setLoadTimeout] = useState<number | undefined>(undefined);
const [loadTimeout, setLoadTimeout] = useState<ReturnType<typeof setTimeout> | undefined>(undefined);
const [featureStatus, setFeatureStatus] = useState<FeatureStatus | undefined>(FeatureStatus.Entitled);
const [isComponentValid, setIsComponentValid] = useState(true);
const [error, setError] = useState<'offline-restricted' | 'url-missing' | undefined>(undefined);
@@ -158,7 +158,7 @@ export const ComponentView: FunctionalComponent<IProps> = observer(
} catch (e) {
}
}
clearTimeout(loadTimeout);
loadTimeout && clearTimeout(loadTimeout);
await application.componentManager.registerComponentWindow(
component,
iframe.contentWindow!