The item-content component handles many cases with complex conditions. Before modifying for making it cleaner, let's write the e2e tests checking the behavior (to prevent regressions).
If there are errors, do not fix them in this PR (you can disable the test temporary)
Acceptance criteria
Cases to be tested:
[ ] Task with description: description should not be shown
[ ] Chapter with description: description should be shown
[ ] Skill with description: description should be shown
[ ] Chapter, with view content perm, no edit perm, not explicit entry, : load/show children (or empty)
[ ] Chapter, with view content perm, no edit perm, explicit entry but 1 result available (mock service for that): load/show children (or empty)
[ ] Chapter, with view content perm, edit children perm, not explicit entry: children edition switch shown, no skill sub/parent shown
[ ] Chapter, with view content perm, edit children perm, not explicit entry, on children-edit url: children edition switch shown, children edition comp shown, no skill sub/parent shown
[ ] Chapter, with view content perm, no edit perm, not explicit entry, on children-edit url: children edition switch shown, children edition comp shown with message, no skill sub/parent shown
[ ] Skill, with view content perm, edit children perm, not explicit entry: children edition switch shown, sub skills sub shown, skill parent shown
[ ] Skill, with view content perm, edit children perm, not explicit entry, on children-edit url:: children edition switch shown, children edition comp shown, sub skills comp NOT shown, skill parent shown
[ ] Task with view content perm, no edit perm, not explicit entry, empty url: error message
[ ] Task with view content perm, edit perm, not explicit entry, empty url: other error message
[ ] Task with view content perm, not explicit entry, non empty url: item-display in dom with opacity 0, "Loading the content" shown
[ ] Task with view content perm, explicit entry, non empty url, a current result available: item-display in dom with opacity 0, "Loading the content" shown
[ ] Chapter, with no view content perm, not explicit entry item, no prerequisite: chapter specific message, no prerequisite part
[ ] Skill, with no view content perm, not explicit entry item: skill specific message
[ ] Task, with no view content perm, not explicit entry item: task specific message
[ ] Chapter, with no view content perm, not explicit entry item, with prerequisite: chapter specific message, with prerequisite part
[ ] Task, with view content perm, explicit entry, results not fetched yet (mock the service for that): "Loading the content" shown
[ ] Task, with view content perm, explicit entry, results fetched but empty so undefined current result: "This activity requires explicit entry", item-display NOT in dom
[ ] Task, with view info perm, explicit entry, a result is returned (mock the service for that): "This activity requires explicit entry", item-display NOT in dom
Overview
The item-content component handles many cases with complex conditions. Before modifying for making it cleaner, let's write the e2e tests checking the behavior (to prevent regressions). If there are errors, do not fix them in this PR (you can disable the test temporary)
Acceptance criteria
Cases to be tested: