Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 2 additions & 12 deletions packages/app/src/components/sidebar/test-suite.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { Element } from '@core/element'
import { html, css, nothing } from 'lit'
import { customElement, property } from 'lit/decorators.js'
import { viewSource } from '../../utils/TestRunner.js'

import { CollapseableEntry } from './collapseableEntry.js'

Expand Down Expand Up @@ -82,17 +83,6 @@ export class ExplorerTestEntry extends CollapseableEntry {
this.requestUpdate()
}

#viewSource() {
if (!this.callSource) {
return
}
window.dispatchEvent(
new CustomEvent('app-source-highlight', {
detail: this.callSource
})
)
}

get hasPassed() {
return this.state === TestState.PASSED
}
Expand Down Expand Up @@ -181,7 +171,7 @@ export class ExplorerTestEntry extends CollapseableEntry {
`}
<button
class="p-1 rounded hover:bg-toolbarHoverBackground my-1 group"
@click="${() => this.#viewSource()}"
@click="${() => viewSource(this.callSource)}"
>
<icon-mdi-eye class="group-hover:text-chartsYellow"></icon-mdi-eye>
</button>
Expand Down
6 changes: 0 additions & 6 deletions packages/app/src/controller/DataManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -167,15 +167,9 @@ export class DataManagerController implements ReactiveController {
...(data as Record<string, string>)
}
this.sourcesContextProvider.setValue(merged)
console.debug('Merged sources keys', Object.keys(merged))
} else {
const providerMap = {
mutations: this.mutationsContextProvider,
logs: this.logsContextProvider,
consoleLogs: this.consoleLogsContextProvider,
metadata: this.metadataContextProvider,
commands: this.commandsContextProvider,
sources: this.sourcesContextProvider,
suites: this.suitesContextProvider
} as const
const provider = providerMap[scope as keyof typeof providerMap]
Expand Down
13 changes: 13 additions & 0 deletions packages/app/src/utils/TestRunner.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
// const RUN_EVENT = 'app-run-tests'
const VIEW_SOURCE_EVENT = 'app-source-highlight'

export const viewSource = (callSource: string | undefined) => {
if (!callSource) {
return
}
window.dispatchEvent(
new CustomEvent(VIEW_SOURCE_EVENT, {
detail: callSource
})
)
}