mirror of
https://github.com/sartography/spiffworkflow-frontend.git
synced 2025-02-24 12:18:17 +00:00
big and green
This commit is contained in:
parent
4144f2c638
commit
ef4910517f
@ -28,7 +28,9 @@ export default function ProcessModelEditDiagram() {
|
|||||||
useState<ScriptUnitTest | null>(null);
|
useState<ScriptUnitTest | null>(null);
|
||||||
const [currentScriptUnitTestIndex, setCurrentScriptUnitTestIndex] =
|
const [currentScriptUnitTestIndex, setCurrentScriptUnitTestIndex] =
|
||||||
useState<number>(-1);
|
useState<number>(-1);
|
||||||
const [unitTestResultIcon, setUnitTestResultIcon] = useState('');
|
const [unitTestResultBool, setUnitTestResultBool] = useState<boolean | null>(
|
||||||
|
null
|
||||||
|
);
|
||||||
|
|
||||||
const params = useParams();
|
const params = useParams();
|
||||||
const navigate = useNavigate();
|
const navigate = useNavigate();
|
||||||
@ -207,7 +209,7 @@ export default function ProcessModelEditDiagram() {
|
|||||||
handleShowScriptEditor();
|
handleShowScriptEditor();
|
||||||
};
|
};
|
||||||
const handleScriptEditorClose = () => {
|
const handleScriptEditorClose = () => {
|
||||||
setUnitTestResultIcon('');
|
setUnitTestResultBool(null);
|
||||||
setShowScriptEditor(false);
|
setShowScriptEditor(false);
|
||||||
};
|
};
|
||||||
const handleEditorScriptChange = (value: any) => {
|
const handleEditorScriptChange = (value: any) => {
|
||||||
@ -238,14 +240,14 @@ export default function ProcessModelEditDiagram() {
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
const setPreviousScriptUnitTest = () => {
|
const setPreviousScriptUnitTest = () => {
|
||||||
setUnitTestResultIcon('');
|
setUnitTestResultBool(null);
|
||||||
const newScriptIndex = currentScriptUnitTestIndex - 1;
|
const newScriptIndex = currentScriptUnitTestIndex - 1;
|
||||||
if (newScriptIndex >= 0) {
|
if (newScriptIndex >= 0) {
|
||||||
setScriptUnitTestElementWithIndex(newScriptIndex);
|
setScriptUnitTestElementWithIndex(newScriptIndex);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
const setNextScriptUnitTest = () => {
|
const setNextScriptUnitTest = () => {
|
||||||
setUnitTestResultIcon('');
|
setUnitTestResultBool(null);
|
||||||
const newScriptIndex = currentScriptUnitTestIndex + 1;
|
const newScriptIndex = currentScriptUnitTestIndex + 1;
|
||||||
const unitTestsModdleElements = getScriptUnitTestElements(scriptElement);
|
const unitTestsModdleElements = getScriptUnitTestElements(scriptElement);
|
||||||
if (newScriptIndex < unitTestsModdleElements.length) {
|
if (newScriptIndex < unitTestsModdleElements.length) {
|
||||||
@ -255,9 +257,9 @@ export default function ProcessModelEditDiagram() {
|
|||||||
|
|
||||||
const processScriptUnitTestRunResult = (result: any) => {
|
const processScriptUnitTestRunResult = (result: any) => {
|
||||||
if (result.result === true) {
|
if (result.result === true) {
|
||||||
setUnitTestResultIcon('✓');
|
setUnitTestResultBool(true);
|
||||||
} else {
|
} else {
|
||||||
setUnitTestResultIcon('✘');
|
setUnitTestResultBool(false);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
const runCurrentUnitTest = () => {
|
const runCurrentUnitTest = () => {
|
||||||
@ -310,7 +312,12 @@ export default function ProcessModelEditDiagram() {
|
|||||||
>
|
>
|
||||||
Run
|
Run
|
||||||
</Button>
|
</Button>
|
||||||
{unitTestResultIcon}
|
{unitTestResultBool === true && (
|
||||||
|
<span style={{ color: 'green', fontSize: '3em' }}>✓</span>
|
||||||
|
)}
|
||||||
|
{unitTestResultBool === false && (
|
||||||
|
<span style={{ color: 'red', fontSize: '3em' }}>✘</span>
|
||||||
|
)}
|
||||||
<Button
|
<Button
|
||||||
data-qa="unit-test-next-button"
|
data-qa="unit-test-next-button"
|
||||||
style={{ fontSize: '1.5em' }}
|
style={{ fontSize: '1.5em' }}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user