mirror of
https://github.com/enso-org/enso.git
synced 2024-12-02 13:43:07 +03:00
f96e5dddd6
Related to https://github.com/enso-org/enso/issues/8518 These tests already caught one regression in nav breadcrumbs: https://github.com/enso-org/enso/issues/8756 It also provides API for mocking expression updates for arbitrary nodes on the screen. The implementation is a bit convoluted and includes setting a callback on `window`, but it looks like the only possible solution given our architecture and playwright restrictions.
59 lines
1.4 KiB
TypeScript
59 lines
1.4 KiB
TypeScript
import 'enso-dashboard/src/tailwind.css'
|
|
import { createPinia } from 'pinia'
|
|
import { createApp, ref } from 'vue'
|
|
import { mockDataHandler, mockLSHandler } from '../mock/engine'
|
|
import '../src/assets/base.css'
|
|
import { provideGuiConfig } from '../src/providers/guiConfig'
|
|
import { provideVisualizationConfig } from '../src/providers/visualizationConfig'
|
|
import { Vec2 } from '../src/util/data/vec2'
|
|
import { MockTransport, MockWebSocket } from '../src/util/net'
|
|
import MockApp from './MockApp.vue'
|
|
|
|
MockTransport.addMock('engine', mockLSHandler)
|
|
MockWebSocket.addMock('data', mockDataHandler)
|
|
|
|
const app = createApp(MockApp)
|
|
app.use(createPinia())
|
|
provideGuiConfig._mock(
|
|
ref({
|
|
startup: {
|
|
project: 'Mock',
|
|
displayedProjectName: 'Mock Project',
|
|
},
|
|
engine: { rpcUrl: 'mock://engine', dataUrl: 'mock://data' },
|
|
}),
|
|
app,
|
|
)
|
|
// Required for visualization stories.
|
|
provideVisualizationConfig._mock(
|
|
{
|
|
fullscreen: false,
|
|
width: 200,
|
|
height: 150,
|
|
hide() {},
|
|
isCircularMenuVisible: false,
|
|
nodeSize: new Vec2(200, 150),
|
|
currentType: {
|
|
module: { kind: 'Builtin' },
|
|
name: 'Current Type',
|
|
},
|
|
types: [
|
|
{
|
|
module: { kind: 'Builtin' },
|
|
name: 'Example',
|
|
},
|
|
{
|
|
module: { kind: 'Builtin' },
|
|
name: 'Types',
|
|
},
|
|
{
|
|
module: { kind: 'Builtin' },
|
|
name: 'Here',
|
|
},
|
|
],
|
|
updateType() {},
|
|
},
|
|
app,
|
|
)
|
|
app.mount('#app')
|