Skip to content

Commit

Permalink
coverage actually passing
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathanzong committed Jan 26, 2024
1 parent 38632c3 commit 46ad87e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/compile/scale/type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,7 @@ function defaultType(
} else if (isFieldDef(fieldDef) && fieldDef.timeUnit && normalizeTimeUnit(fieldDef.timeUnit).utc) {
return 'utc';
} else if (isTime(channel)) {
// return 'linear';
return 'band'; // TODO(jzong): when interpolation is implemented, this should be 'linear'
return 'linear';

Check warning on line 120 in src/compile/scale/type.ts

View check run for this annotation

Codecov / codecov/patch

src/compile/scale/type.ts#L120

Added line #L120 was not covered by tests
}

return 'time';
Expand All @@ -135,8 +134,7 @@ function defaultType(
// TODO: consider using quantize (equivalent to binning) once we have it
return 'ordinal';
} else if (isTime(channel)) {
// return 'linear';
return 'band'; // TODO(jzong): when interpolation is implemented, this should be 'linear'
return 'linear';

Check warning on line 137 in src/compile/scale/type.ts

View check run for this annotation

Codecov / codecov/patch

src/compile/scale/type.ts#L137

Added line #L137 was not covered by tests
}

return 'linear';
Expand Down
7 changes: 7 additions & 0 deletions test/compile/scale/type.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,13 @@ describe('compile/scale', () => {
});
});
});

describe('time (animation)', () => {
it('should return band scale for nominal/ordinal data by default.', () => {
expect(scaleType({}, 'time', {type: 'nominal'}, 'point')).toEqual(ScaleType.BAND);
expect(scaleType({}, 'time', {type: 'ordinal'}, 'point')).toEqual(ScaleType.BAND);
});
});
});

describe('temporal', () => {
Expand Down

0 comments on commit 46ad87e

Please sign in to comment.