Fix autotest koeventpopupmenutest
AbandonedPublic

Authored by gjditchfield on May 13 2020, 2:01 AM.

Details

Reviewers
mlaurent
Summary
  • Deleted createEventFromEvent() because the event-specific menu no longer has a menu item that creates another event.
  • Deleted createTodoFromTodo() for the same reason.
  • Switched away from findChild() because menu items no longer have object names. Switched to C-locale item text; since it is key to i18n, it should be stable.
Test Plan

Run koeventpopupmenutest.

Diff Detail

Repository
R210 KOrganizer
Branch
fixtest (branched from master)
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 26814
Build 26832: arc lint + arc unit
gjditchfield created this revision.May 13 2020, 2:01 AM
Restricted Application added a project: KDE PIM. · View Herald TranscriptMay 13 2020, 2:01 AM
Restricted Application added a subscriber: kde-pim. · View Herald Transcript
gjditchfield requested review of this revision.May 13 2020, 2:01 AM

It would be helpful to describe why your removed the two test cases

mlaurent requested changes to this revision.May 13 2020, 9:17 AM
mlaurent added a subscriber: mlaurent.
mlaurent added inline comments.
src/autotests/koeventpopupmenutest.cpp
222

not sure that it"s a good idea to test exact text as it can be change by KF5 etc.

This revision now requires changes to proceed.May 13 2020, 9:17 AM
gjditchfield added inline comments.May 13 2020, 3:48 PM
src/autotests/koeventpopupmenutest.cpp
222

Can KF5 change the text? I think that for these menu items it is defined in KOEventPopupMenu::appendEditOnlyItems()

gjditchfield edited the summary of this revision. (Show Details)May 13 2020, 4:54 PM
mlaurent added inline comments.May 13 2020, 6:25 PM
src/autotests/koeventpopupmenutest.cpp
222

Indeed it's define here but I think it's not real useful to test text directly.
Testing objectName is more logical as previously.

gjditchfield added inline comments.May 13 2020, 8:27 PM
src/autotests/koeventpopupmenutest.cpp
222

Perhaps the entire defaultMenuEventVisible() function should be deleted?

The old code checked that the "create note" and "create todo" items were visible, but createTodoFromEvent() and createNoteFromEvent() have already tested that. The old code also tested that the "create event" item exists but is not visible -- that is an implementation detail of KOEventPopupMenu, and seems like a poor test to me.

I added tests for the existence of the current default menu items, because I thought it was in the spirit of the old code, but my new tests don't check that the items actually do anything, so they are nearly pointless.

I'd like to delete both defaultMenuTodoVisible() and defaultMenuEventVisible().

gjditchfield abandoned this revision.May 22 2020, 6:21 PM