TenzaiExposureSidebar

Renders the Validate tab's left-column exposure detail: a Timeline card showing the lead's status history (OPEN / IN_PROGRESS / BLOCKED … with timestamps). Reads the persisted Tenzai Timeline grid field.

python · Tenzai

Details

IDTenzaiExposureSidebar
Languagepython
From Version6.10.0
Docker Imagedemisto/python3:3.12.14.13053055
Tagsdynamic-section

README

Renders the Validate tab’s left-column exposure detail: a Timeline card showing the exposure lead’s status history (OPEN / IN_PROGRESS / BLOCKED / MATERIALIZED / INVALIDATED, with timestamps). Reads the persisted Tenzai Timeline grid field on the issue.

This script is a dynamic-section widget used by the Tenzai Issue Layout and is not intended to be run directly.

Script Data


Name Description
Script Type python3
Tags dynamic-section
Cortex XSOAR Version 6.10.0

Inputs


There are no inputs for this script.

Outputs


There are no outputs for this script.

"""Unit tests for the TenzaiExposureSidebar dynamic-section widget."""

from TenzaiExposureSidebar import build_sidebar_html


def test_empty_state_placeholder():
    html = build_sidebar_html({})
    assert "No exposure timeline yet" in html


def test_timeline_card_renders_rows_with_status_and_time():
    fields = {
        "tenzaitimeline": [
            {"status": "OPEN", "time": "08-16 14:53:46"},
            {"status": "IN_PROGRESS", "time": "08-16 14:59:50"},
            {"status": "BLOCKED", "time": "08-16 15:01:10"},
        ]
    }
    html = build_sidebar_html(fields)
    assert ">Timeline<" in html
    assert "OPEN" in html
    assert "IN_PROGRESS" in html
    assert "BLOCKED" in html
    assert "08-16 15:01:10" in html
    assert "#f2607b" in html  # BLOCKED renders the red dot


def test_tolerates_non_list_field():
    html = build_sidebar_html({"tenzaitimeline": "garbage"})
    assert "No exposure timeline yet" in html