Skip to content

Commit

Permalink
Moving change to correct place
Browse files Browse the repository at this point in the history
Adding unit test
  • Loading branch information
r4j4h committed Jan 5, 2015
1 parent d4bbc90 commit 9b0c298
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion dc.js
Original file line number Diff line number Diff line change
Expand Up @@ -959,7 +959,7 @@ dc.baseMixin = function (_chart) {
if (a && a.replace) {
return a.replace('#', '');
}
return 'dc-chart' + _chart.chartID();
return '' + _chart.chartID();
};

/**
Expand Down
5 changes: 5 additions & 0 deletions spec/base-mixin-spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,11 @@ describe("dc.baseMixin", function () {
expect(dc.utils.isNumber(chart.anchorName())).toBeFalsy();
expect(chart.anchorName()).toMatch(/\d+/);
});

it('should return a string that begins with a non-numeric character', function () {
expect(chart.anchorName()).toMatch(/[^\d][\w]*/);
});

});
});

Expand Down
2 changes: 1 addition & 1 deletion src/base-mixin.js
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@ dc.baseMixin = function (_chart) {
if (a && a.replace) {
return a.replace('#', '');
}
return '' + _chart.chartID();
return 'dc-chart' + _chart.chartID();
};

/**
Expand Down

0 comments on commit 9b0c298

Please sign in to comment.