@finos/legend-studio
Version:
123 lines • 5.2 kB
TypeScript
/**
* Copyright (c) 2020-present, Goldman Sachs
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import type { MappingEditorState, MappingElementSource } from './MappingEditorState.js';
import { type GeneratorFn } from '@finos/legend-shared';
import type { EditorStore } from '../../../EditorStore.js';
import { type MappingTest, type RawLambda, type Runtime, type InputData, type MappingTestAssert, type Mapping, ExpectedOutputMappingTestAssert, ObjectInputData, FlatDataInputData, RelationalInputData } from '@finos/legend-graph';
import { ExecutionPlanState, LambdaEditorState } from '@finos/legend-application';
export declare enum TEST_RESULT {
NONE = "NONE",
ERROR = "ERROR",
FAILED = "FAILED",
PASSED = "PASSED"
}
export declare class MappingTestQueryState extends LambdaEditorState {
editorStore: EditorStore;
test: MappingTest;
isInitializingLambda: boolean;
query: RawLambda;
constructor(editorStore: EditorStore, test: MappingTest, query: RawLambda);
get lambdaId(): string;
setIsInitializingLambda(val: boolean): void;
updateLamba(val: RawLambda): GeneratorFn<void>;
convertLambdaObjectToGrammarString(pretty?: boolean): GeneratorFn<void>;
convertLambdaGrammarStringToObject(): GeneratorFn<void>;
}
declare abstract class MappingTestInputDataState {
readonly uuid: string;
editorStore: EditorStore;
mapping: Mapping;
inputData: InputData;
constructor(editorStore: EditorStore, mapping: Mapping, inputData: InputData);
abstract get runtime(): Runtime;
}
export declare class MappingTestObjectInputDataState extends MappingTestInputDataState {
inputData: ObjectInputData;
/**
* @workaround https://github.com/finos/legend-studio/issues/68
*/
data: string;
constructor(editorStore: EditorStore, mapping: Mapping, inputData: ObjectInputData);
setData(val: string): void;
get runtime(): Runtime;
}
export declare class MappingTestFlatDataInputDataState extends MappingTestInputDataState {
inputData: FlatDataInputData;
get runtime(): Runtime;
}
export declare class MappingTestRelationalInputDataState extends MappingTestInputDataState {
inputData: RelationalInputData;
get runtime(): Runtime;
}
declare abstract class MappingTestAssertionState {
readonly uuid: string;
assert: MappingTestAssert;
constructor(assert: MappingTestAssert);
}
export declare class MappingTestExpectedOutputAssertionState extends MappingTestAssertionState {
assert: ExpectedOutputMappingTestAssert;
/**
* @workaround https://github.com/finos/legend-studio/issues/68
*/
expectedResult: string;
constructor(assert: ExpectedOutputMappingTestAssert);
setExpectedResult(val: string): void;
}
export declare enum MAPPING_TEST_EDITOR_TAB_TYPE {
SETUP = "Test Setup",
RESULT = "Test Result"
}
export declare class MappingTestState {
readonly uuid: string;
selectedTab: MAPPING_TEST_EDITOR_TAB_TYPE;
editorStore: EditorStore;
mappingEditorState: MappingEditorState;
result: TEST_RESULT;
test: MappingTest;
runTime: number;
isSkipped: boolean;
errorRunningTest?: Error | undefined;
testExecutionResultText?: string | undefined;
isRunningTest: boolean;
isExecutingTest: boolean;
queryState: MappingTestQueryState;
inputDataState: MappingTestInputDataState;
assertionState: MappingTestAssertionState;
isGeneratingPlan: boolean;
executionPlanState: ExecutionPlanState;
constructor(editorStore: EditorStore, test: MappingTest, mappingEditorState: MappingEditorState);
setSelectedTab(val: MAPPING_TEST_EDITOR_TAB_TYPE): void;
buildQueryState(): MappingTestQueryState;
buildInputDataState(): MappingTestInputDataState;
buildAssertionState(): MappingTestAssertionState;
resetTestRunStatus(): void;
setResult(result: TEST_RESULT): void;
toggleSkipTest(): void;
setQueryState: (queryState: MappingTestQueryState) => void;
setInputDataState: (inputDataState: MappingTestInputDataState) => void;
setAssertionState: (assertionState: MappingTestAssertionState) => void;
setInputDataStateBasedOnSource(source: MappingElementSource | undefined, populateWithMockData: boolean): void;
/**
* Execute mapping using current info in the test detail panel then set the execution result value as test expected result
*/
regenerateExpectedResult(): GeneratorFn<void>;
runTest(): GeneratorFn<void>;
onTestStateOpen(openTab?: MAPPING_TEST_EDITOR_TAB_TYPE): GeneratorFn<void>;
updateAssertion(): void;
generatePlan(debug: boolean): GeneratorFn<void>;
}
export {};
//# sourceMappingURL=MappingTestState.d.ts.map