enso/app/gui2/e2e/main.ts
somebody1234 9b7e3d0f16
E2E tests (#8239)
- Closes #8179

# Important Notes
- ⚠️ These tests are currently *not run* on any CI workflow.
- There is some unused code for mocking the PM. This has been intentionally kept, as this may be useful in the future.
Note that this may be useful for testing the dashboard, however the dashboard is currently only tested in cloud mode
- that is, without the backend switcher, and with only the remote backend available. As such, currently it uses HTTP API mocks, and no PM mock.
2023-11-27 15:48:37 +00:00

59 lines
1.4 KiB
TypeScript

import 'enso-dashboard/src/tailwind.css'
import { createPinia } from 'pinia'
import { createApp, ref } from 'vue'
import '../src/assets/base.css'
import { provideGuiConfig } from '../src/providers/guiConfig'
import { provideVisualizationConfig } from '../src/providers/visualizationConfig'
import { MockTransport, MockWebSocket } from '../src/util/net'
import { Vec2 } from '../src/util/vec2'
import MockApp from './MockApp.vue'
import { mockDataHandler, mockLSHandler } from './mockEngine'
MockTransport.addMock('engine', mockLSHandler)
MockWebSocket.addMock('data', mockDataHandler)
const app = createApp(MockApp)
app.use(createPinia())
provideGuiConfig._mock(
ref({
startup: {
project: 'Mock Project',
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')