Files
Kareer/autotests/CMakeLists.txt
T
austinandClaude Opus 5 aa3a31f014 Fix the edit form so Save persists stage changes
Changing an application's stage and pressing Save closed the form
without saving the stage: JobsDatabase::updateJob() deliberately skips
the stage column so every move lands in stage_history, but
JobEditModel::save() never followed up with setStage(). It now does,
as the CLI's update command always has.

Also:
- Validate that company and title are non-empty and say so, instead of
  saving a blank field
- Always set lastError on failure, clear it on the next attempt, and
  bind the page's error message to it
- Reload the form's values when jobsModel is assigned, since QML does
  not guarantee it is set before editingJobId
- Bind the salary spin boxes to the model and write back only on user
  edits; guard the notes field the same way
- Add jobeditmodeltest covering load order, edits, stage history,
  salaries round-tripping, adding, and validation errors

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01BxDf7HqD1xPnsZP8wt3NTk
2026-09-11 15:41:48 -05:00

64 lines
1.3 KiB
CMake

# SPDX-FileCopyrightText: 2026 ToServeTheKing <[email protected]>
#
# SPDX-License-Identifier: GPL-3.0-or-later
add_executable(jobsdatabasetest
jobsdatabasetest.cpp
../src/jobstage.cpp
../src/jobsdatabase.cpp
)
target_include_directories(jobsdatabasetest PRIVATE ../src)
target_link_libraries(jobsdatabasetest PRIVATE
Qt6::Core
Qt6::Gui
Qt6::Sql
Qt6::Test
KF6::I18n
)
add_test(NAME jobsdatabasetest COMMAND jobsdatabasetest)
add_executable(sankeylayouttest
sankeylayouttest.cpp
../src/jobstage.cpp
../src/jobsdatabase.cpp
../src/sankeymodel.cpp
)
target_include_directories(sankeylayouttest PRIVATE ../src)
target_link_libraries(sankeylayouttest PRIVATE
Qt6::Core
Qt6::Gui
Qt6::Qml
Qt6::Sql
Qt6::Test
KF6::I18n
)
add_test(NAME sankeylayouttest COMMAND sankeylayouttest)
add_executable(jobeditmodeltest
jobeditmodeltest.cpp
../src/jobstage.cpp
../src/jobsdatabase.cpp
../src/jobsmodel.cpp
../src/jobeditmodel.cpp
../src/jobfieldcatalog.cpp
)
target_include_directories(jobeditmodeltest PRIVATE ../src)
target_link_libraries(jobeditmodeltest PRIVATE
Qt6::Core
Qt6::Gui
Qt6::Qml
Qt6::Sql
Qt6::Test
KF6::I18n
)
add_test(NAME jobeditmodeltest COMMAND jobeditmodeltest)