mgradwohl / mgradwohl/gnotepad
Investigate commented-out Delete action test code in menuactions.cpp
- Dominant language
- C++
- Stars
- 0
- Forks
- 0
- PR merge metrics
- No merged PRs in 30d
Description
## Summary
There is commented-out test code for a Delete action in the test suite that needs clarification.
### Location 1: `tests/menuactions/menuactions.cpp` (lines 186-189)
In the `testCutCopyDeleteEnabledStates` function:
```cpp
// if (action->text().contains(QStringLiteral("Delete")))
// {
// hasDeleteAction = true;
// }
```
Note: The `hasDeleteAction` variable is declared but never used because this code is commented out.
### Location 2: `tests/smoke/smoke.cpp` (lines 1545-1556)
In the `testDateFormatPreference` function, similar pattern for Date Format actions:
```cpp
// auto actions = window.findChildren();
// bool hasDateFormatAction = false;
// for (const auto* action : actions)
// {
// if (action->text().contains(QStringLiteral("Date Format"), Qt::CaseInsensitive) ||
// action->text().contains(QStringLiteral("Short"), Qt::CaseInsensitive) ||
// action->text().contains(QStringLiteral("Long"), Qt::CaseInsensitive))
// {
// hasDateFormatAction = true;
// break;
// }
// }
```
## Questions to resolve
1. **Was the Delete action intentionally removed from the UI?** If so, this commented code should be deleted.
2. **Is the Delete action planned but not yet implemented?** If so, this should be tracked as a feature request.
3. **Is the Delete action present but under a different name?** The test may need updating to use the correct action text.
4. **Same questions apply to Date Format actions** - are they exposed in the UI?
## Context
This pattern of commenting out tests suggests features that may not be fully implemented or exposed in the UI yet.
## Suggested resolution
- If Delete action is not part of the application design, remove the commented code and the unused `hasDeleteAction` variable
- If Delete action should exist, investigate why it's missing and create a follow-up issue
- Update the test function name (`testCutCopyDeleteEnabledStates`) to match what it actually tests if Delete is intentionally excluded
- Apply same cleanup to Date Format action code in smoke.cpp
Contributor guide
Research direction
Inspect the commented sections in tests/menuactions/menuactions.cpp and tests/smoke/smoke.cpp, then trace whether the Delete and Date Format actions are exposed by the application. Confirm their intended status with the current UI behavior; done means removing obsolete commented code and the unused variable, or documenting the missing feature and updating the test scope.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- desktop, testing
- Issue type
- Refactor
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100