show submitted status on grouped planner items
fixes ADMIN-1291 test plan: - Find/create assignment with no submissions (and not graded or excused) - Submit assignment - Planner puts it in "Show n completed items" group, and the group shows 'Submitted' badge - Grade the assignment. Planner no longer shows Submitted badge on the group - Change grade to Excused. Planner still doesn't show Submitted badge Change-Id: I5136413eac8eca87b94f48518739d7abf64b7e0c Reviewed-on: https://gerrit.instructure.com/159486 Tested-by: Jenkins Reviewed-by: Dan Minkevitch <dan@instructure.com> Reviewed-by: Ed Schiebel <eschiebel@instructure.com> QA-Review: Ed Schiebel <eschiebel@instructure.com> Product-Review: Carl Kibler <ckibler@instructure.com>
This commit is contained in:
parent
e97dfa167a
commit
a22113c6c3
|
@ -113,6 +113,24 @@ describe('getBadgesForItems', () => {
|
|||
expect(getBadgesForItems(items)).toEqual([]);
|
||||
});
|
||||
|
||||
it('returns Submitted object when at least one item is submitted but not graded or excused', () => {
|
||||
const items = [{ newActivity: false, status: { submitted: true, graded: false, excused: false } }];
|
||||
expect(getBadgesForItems(items)).toContainEqual({
|
||||
id: 'submitted',
|
||||
text: 'Submitted'
|
||||
});
|
||||
});
|
||||
|
||||
it('does not return Submitted object when an item is submitted but also graded', () => {
|
||||
const items = [{ newActivity: false, status: { submitted: true, graded: true, excused: false } }];
|
||||
expect(getBadgesForItems(items)).toEqual([]);
|
||||
});
|
||||
|
||||
it('does not return Submitted object when an item is submitted but also excused', () => {
|
||||
const items = [{ newActivity: false, status: { submitted: true, graded: false, excused: true } }];
|
||||
expect(getBadgesForItems(items)).toEqual([]);
|
||||
});
|
||||
|
||||
it('returns New Feedback object when at least one new activity item has a has_feedback status', () => {
|
||||
const items = [{ status: { fake: true } }, { newActivity: true, status: { has_feedback: true } }];
|
||||
expect(getBadgesForItems(items)).toContainEqual({
|
||||
|
|
|
@ -94,6 +94,9 @@ export function getBadgesForItems (items) {
|
|||
if (items.some(i => i.status && i.newActivity && i.status.graded && !i.status.excused)) {
|
||||
badges.push(PILL_MAPPING.new_grades());
|
||||
}
|
||||
if (items.some(i => i.status && i.status.submitted && !i.status.graded && !i.status.excused)) {
|
||||
badges.push(PILL_MAPPING.submitted());
|
||||
}
|
||||
if (items.some(showPillForOverdueStatus.bind(this, 'missing'))) {
|
||||
badges.push(PILL_MAPPING.missing());
|
||||
} else if (items.some(showPillForOverdueStatus.bind(this, 'late'))) {
|
||||
|
|
Loading…
Reference in New Issue