# GUI unit tests. Lane GUI.
#
# CLAUDE.md §5: a feature with no test does not exist. The model is the piece with real
# logic that can be tested headless — the progress patch must be a narrow dataChanged and
# must never reset the model (docs/03-gui-spec.md §1).

set(CMAKE_AUTOMOC ON)

find_package(Qt6 REQUIRED COMPONENTS Test)

add_executable(tst_downloadtablemodel
    tst_downloadtablemodel.cpp
    ${CMAKE_CURRENT_SOURCE_DIR}/../src/models/DownloadTableModel.cpp
)

target_include_directories(tst_downloadtablemodel PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/../src)
target_compile_features(tst_downloadtablemodel PRIVATE cxx_std_23)
target_compile_options(tst_downloadtablemodel PRIVATE -Wall -Wextra -Wpedantic -Werror)
target_link_libraries(tst_downloadtablemodel PRIVATE Qt6::Core Qt6::Test)

add_test(NAME gui_downloadtablemodel COMMAND tst_downloadtablemodel)
set_tests_properties(gui_downloadtablemodel PROPERTIES LABELS "gui")
