Skip to content

Commit 95c782f

Browse files
author
Jared Parnell
committed
data-quality: schedule: Catch errors when the model or subclassgraph is unknown
1 parent 4bb1e75 commit 95c782f

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

src/rules/data-quality/scheduleeventype-is-valid-event-subclass-rule-spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ describe('ScheduleEventTypeIsEventSubclass', () => {
9191
}
9292
});
9393

94-
it('should return errors if scheduleEventType does not have a subClassGraph', async () => {
94+
it('should not errors if scheduleEventType does not have a subClassGraph', async () => {
9595
const model = new Model({
9696
type: 'Schedule',
9797
subClassGraph: ['#Event'],

src/rules/data-quality/scheduleeventype-is-valid-event-subclass-rule.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ module.exports = class ScheduleEventTypeIsEventSubclass extends Rule {
6363
errorCondition = 'modelIsNotEventSubClass';
6464
}
6565

66-
if (errorCondition === 'modelIsNotEventSubClass') {
66+
if (errorCondition) {
6767
errors.push(
6868
this.createError(
6969
errorCondition,
@@ -73,8 +73,6 @@ module.exports = class ScheduleEventTypeIsEventSubclass extends Rule {
7373
},
7474
),
7575
);
76-
} else {
77-
return [];
7876
}
7977

8078
return errors;

0 commit comments

Comments
 (0)