Skip to content

Commit

Permalink
fix: check status in tree view for skipped tests (#619)
Browse files Browse the repository at this point in the history
* fix: check status in tree view for skipped tests

* fix: do not expand node that doesn't have any children in tree view
  • Loading branch information
shadowusr authored Nov 27, 2024
1 parent a3ff4d8 commit ee2eb8c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 3 additions & 1 deletion lib/static/modules/reducers/suites-page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,10 @@ export default (state: State, action: SomeAction): State => {
const newExpandedTreeNodesById: Record<string, boolean> = {};

while (nodeData) {
newExpandedTreeNodesById[nodeData.id] = true;
nodeData = nodeData.parentData ?? null;
if (nodeData) {
newExpandedTreeNodesById[nodeData.id] = true;
}
}

return applyStateUpdate(state, {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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 <div className={styles.skipReasonContainer}>
<div className={styles.skipReason}>Skipped ⋅ {makeLinksClickable(props.item.skipReason)}</div>
</div>;
Expand Down

0 comments on commit ee2eb8c

Please sign in to comment.