Set up end-to-end tests (#85)
This commit is contained in:
parent
3c369b435e
commit
d0965d17e4
22 changed files with 1470 additions and 108 deletions
|
@ -17,7 +17,7 @@ export function createBundles(watch: boolean) {
|
|||
loader: {'.png': 'file', '.svg': 'dataurl'},
|
||||
bundle: true,
|
||||
sourcemap: true,
|
||||
define: definedGlobals,
|
||||
define: {...definedGlobals, __IS_VISUAL_REGRESSION_TESTING: 'false'},
|
||||
watch,
|
||||
external: [
|
||||
'@theatre/dataverse',
|
||||
|
|
1
theatre/globals.d.ts
vendored
1
theatre/globals.d.ts
vendored
|
@ -1,5 +1,6 @@
|
|||
interface Window {
|
||||
__REDUX_DEVTOOLS_EXTENSION__?: $IntentionalAny
|
||||
__IS_VISUAL_REGRESSION_TESTING?: boolean
|
||||
}
|
||||
|
||||
interface NodeModule {
|
||||
|
|
|
@ -25,12 +25,15 @@ export default class UI {
|
|||
pointer-events: none;
|
||||
z-index: 100;
|
||||
`
|
||||
this.containerShadow = this.containerEl.attachShadow({
|
||||
mode: 'open',
|
||||
// To see why I had to cast this value to HTMLElement, take a look at its
|
||||
// references of this prop. There are a few functions that actually work
|
||||
// with a ShadowRoot but are typed to accept HTMLElement
|
||||
}) as $IntentionalAny as ShadowRoot & HTMLElement
|
||||
this.containerShadow =
|
||||
window.__IS_VISUAL_REGRESSION_TESTING === true
|
||||
? (document.getElementById('root') as $IntentionalAny)
|
||||
: (this.containerEl.attachShadow({
|
||||
mode: 'open',
|
||||
// To see why I had to cast this value to HTMLElement, take a look at its
|
||||
// references of this prop. There are a few functions that actually work
|
||||
// with a ShadowRoot but are typed to accept HTMLElement
|
||||
}) as $IntentionalAny as ShadowRoot & HTMLElement)
|
||||
}
|
||||
|
||||
render() {
|
||||
|
|
|
@ -85,7 +85,11 @@ export default function UIRoot() {
|
|||
return !initialised ? null : (
|
||||
<StyleSheetManager
|
||||
disableVendorPrefixes
|
||||
target={getStudio()!.ui.containerShadow}
|
||||
target={
|
||||
window.__IS_VISUAL_REGRESSION_TESTING === true
|
||||
? undefined
|
||||
: getStudio()!.ui.containerShadow
|
||||
}
|
||||
>
|
||||
<>
|
||||
<GlobalStyle />
|
||||
|
|
|
@ -109,7 +109,7 @@ const DetailPanel: React.FC<{}> = (props) => {
|
|||
if (obj) {
|
||||
return (
|
||||
<Container>
|
||||
<Content>
|
||||
<Content data-testid="DetailPanel-Object">
|
||||
<Header>
|
||||
<Title
|
||||
title={`${obj.sheet.address.sheetId}: ${obj.sheet.address.sheetInstanceId} > ${obj.address.objectKey}`}
|
||||
|
|
|
@ -166,7 +166,10 @@ const OutlinePanel: React.FC<{}> = (props) => {
|
|||
<Container>
|
||||
<TriggerContainer>
|
||||
{triggerTooltip}
|
||||
<TriggerButton ref={triggerButtonRef as $IntentionalAny}>
|
||||
<TriggerButton
|
||||
ref={triggerButtonRef as $IntentionalAny}
|
||||
data-testid="OutlinePanel-TriggerButton"
|
||||
>
|
||||
<VscListTree />
|
||||
</TriggerButton>
|
||||
{conflicts.length > 0 ? (
|
||||
|
@ -177,7 +180,7 @@ const OutlinePanel: React.FC<{}> = (props) => {
|
|||
{/* <Title>Outline</Title> */}
|
||||
</TriggerContainer>
|
||||
<Content>
|
||||
<Body>
|
||||
<Body data-testid="OutlinePanel-Content">
|
||||
<ProjectsList />
|
||||
</Body>
|
||||
</Content>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue