From 7bc3cb921828b4165d6f952f495b091f03f4ea75 Mon Sep 17 00:00:00 2001 From: shadowusr Date: Wed, 27 Nov 2024 01:20:23 +0300 Subject: [PATCH 1/2] fix: check status in tree view for skipped tests --- .../features/suites/components/TreeViewItemSubtitle/index.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/static/new-ui/features/suites/components/TreeViewItemSubtitle/index.tsx b/lib/static/new-ui/features/suites/components/TreeViewItemSubtitle/index.tsx index c43c115a..7e283cad 100644 --- a/lib/static/new-ui/features/suites/components/TreeViewItemSubtitle/index.tsx +++ b/lib/static/new-ui/features/suites/components/TreeViewItemSubtitle/index.tsx @@ -8,6 +8,7 @@ import {ImageEntityFail} from '@/static/new-ui/types/store'; import styles from './index.module.css'; import {getAssertViewStatusMessage} from '@/static/new-ui/utils/assert-view-status'; import {makeLinksClickable} from '@/static/new-ui/utils'; +import {TestStatus} from '@/constants'; interface TreeViewItemSubtitleProps { item: TreeViewItemData; @@ -17,7 +18,7 @@ interface TreeViewItemSubtitleProps { } export function TreeViewItemSubtitle(props: TreeViewItemSubtitleProps): ReactNode { - if (props.item.skipReason) { + if (props.item.status === TestStatus.SKIPPED && props.item.skipReason) { return
Skipped ⋅ {makeLinksClickable(props.item.skipReason)}
; From 5fcddd001ce4291da3da55228eef19318f690131 Mon Sep 17 00:00:00 2001 From: shadowusr Date: Wed, 27 Nov 2024 01:31:04 +0300 Subject: [PATCH 2/2] fix: do not expand node that doesn't have any children in tree view --- lib/static/modules/reducers/suites-page.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/static/modules/reducers/suites-page.ts b/lib/static/modules/reducers/suites-page.ts index 47bdf23f..d03394ae 100644 --- a/lib/static/modules/reducers/suites-page.ts +++ b/lib/static/modules/reducers/suites-page.ts @@ -123,8 +123,10 @@ export default (state: State, action: SomeAction): State => { const newExpandedTreeNodesById: Record = {}; while (nodeData) { - newExpandedTreeNodesById[nodeData.id] = true; nodeData = nodeData.parentData ?? null; + if (nodeData) { + newExpandedTreeNodesById[nodeData.id] = true; + } } return applyStateUpdate(state, {