betodealmeida commented on a change in pull request #4606: Use 'count' as the
default metric when available
URL:
https://github.com/apache/incubator-superset/pull/4606#discussion_r175618643
##########
File path: superset/assets/spec/javascripts/modules/utils_spec.jsx
##########
@@ -69,4 +70,31 @@ describe('utils', () => {
expect(defaultNumberFormatter(-111000000)).to.equal('-111M');
expect(defaultNumberFormatter(-0.23)).to.equal('-230m');
});
+ describe('mainMetric', () => {
+ it('is null when no options', () => {
+ expect(mainMetric([])).to.equal(undefined);
+ expect(mainMetric(null)).to.equal(undefined);
+ });
+ it('is prefers the "count" metric when first', () => {
+ const metrics = [
+ { metric_name: 'count' },
+ { metric_name: 'foo' },
+ ];
+ expect(mainMetric(metrics)).to.equal('count');
+ });
+ it('is prefers the "count" metric when not first', () => {
Review comment:
Nit: remove "is" before "prefers".
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services