Check next sortie checklist item consistency
This commit is contained in:
@@ -9595,6 +9595,12 @@ function assertSortieTacticalRoster(state, requiredUnitIds) {
|
||||
if (state.sortieChecklistSummary.complete !== (state.sortieChecklistSummary.completeCount === state.sortieChecklistSummary.total)) {
|
||||
throw new Error(`Expected sortie checklist completion flag to match summary counts: ${JSON.stringify(state.sortieChecklistSummary)}`);
|
||||
}
|
||||
if (state.sortieChecklistSummary.complete && state.sortieChecklistSummary.nextIncompleteLabel !== null) {
|
||||
throw new Error(`Expected complete sortie checklist summary to clear next incomplete item: ${JSON.stringify(state.sortieChecklistSummary)}`);
|
||||
}
|
||||
if (!state.sortieChecklistSummary.complete && !state.sortieChecklistSummary.nextIncompleteLabel) {
|
||||
throw new Error(`Expected incomplete sortie checklist summary to expose next incomplete item: ${JSON.stringify(state.sortieChecklistSummary)}`);
|
||||
}
|
||||
|
||||
const missingIds = requiredUnitIds.filter((unitId) => !state.sortieRoster.some((unit) => unit.id === unitId));
|
||||
if (missingIds.length > 0) {
|
||||
|
||||
Reference in New Issue
Block a user