import { BadgeSpec } from '@kui-shell/core'; interface TestParam { command: string; testName?: string; metadata: { name: string; namespace?: string; }; } interface Label { mode: string; label?: string; } interface PlainTextContent { content?: string; contentType: 'text/plain' | 'text/markdown' | 'text/html' | 'yaml'; editor?: false; } interface ReactContent { selector: string; innerText: string; contentType: 'react'; } interface TableContent { nRows: number; nCells: number; contentType: 'table'; } interface YamlContentWithEditor { content: object; contentType: 'yaml'; editor: true; } interface ClickExpect { command: string; expect?: string; } export type MMRExpectMode = Label & (PlainTextContent | YamlContentWithEditor | TableContent | ReactContent); export declare class TestMMR { readonly param: TestParam; /** * new TestMMR() instantiates a class of multi-model-response tests * @param { TestParam } param includes: command, testName and metadata * @param { string } command is the command needs to be executed * @param { string } testName (optional) helps with filtering the Mocha Test Suites by description * @param { string } metadata is the metadata shown in Sidecar */ constructor(param: TestParam); private testClickResult; /** * name() starts a Mocha Test Suite * name() executes `command` in REPL and expects `prettyName` or `name` is shown in Sidecar */ name(opt?: { nameHash?: string; prettyName?: string; onclick?: { name?: ClickExpect; nameHash?: ClickExpect; }; }): void; /** * namespace() starts a Mocha Test Suite * namespace() executes `command` in REPL and expects `namespace` is shown in Sidecar * */ namespace(opt?: { onclick: ClickExpect; }): void; /** * kind() starts a Mocha Test Suite * kind() executes `command` in REPL and expects `kind` is showin in Sidecar * @param { string } kind is the expected kind text shown in the Sidecar * */ kind(kind: string): void; /** * badges() starts a Mocha Test Suite * badges() executes `command` in REPL and expects `badges` are showin in Sidecar * @param { BadgeSpec[] } badges is the expected badges shown in the Sidecar * */ badges(badges: BadgeSpec[]): void; /** * modes() starts a Mocha Test Suite * modes() executes `command` in REPL and expects `modes` are showin in Sidecar * @param { MMRExpectMode[] } expectModes is the expected modes shown as Sidecar Tabs * @param { MMRExpectMode } defaultMode is the expected default Sidecar Tab * * */ modes(expectModes: MMRExpectMode[], defaultMode: MMRExpectMode): void; diffPlainText(mode: string, textB: string): void; /** * toolbarButtons() starts a Mocha Test Suite * toolbarButtons() executes `command` and expects the `buttons` shown in Sidecar having correct labels and drildown handlers * * @param buttons is the expected array of `button` shown in the Sidecar Toolbar * */ toolbarButtons(buttons: { mode: string; label?: string; command: string | (() => string); kind: 'drilldown' | 'view'; confirm?: boolean; expectError?: 127; }[]): void; /** * toolbarText() starts a Mocha Test Suite * toolbarText() executes `command` and expects Sidecar Toolbar has correct `text` and `type` * * @param toolbarText is the expected text content and type shown in the Sidecar Toolbar */ toolbarText(toolbarText: { type: string; text: string; exact?: boolean; }): void; toolbarNotExist(): void; } export {};