Skip to content

Commit

Permalink
more specific test for valid, selectable id
Browse files Browse the repository at this point in the history
@r4j4h, as commented in #800.  Thanks again!
  • Loading branch information
gordonwoodhull committed Jan 12, 2015
1 parent bd1c01b commit d20a75f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
5 changes: 4 additions & 1 deletion Changelog.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
## 2.0.0 alpha 6
## 2.0.0 beta 1
* Merged #800: unselectable ids starting with numbers #789. Thanks Jasmine Hegman!
* Interface and features frozen - from this point all fixes will be merged to
`master` and `develop`, and all interface changes only merged to `develop`.

## Starting dc.js Changelog
* Here we start using git-flow, start a changelog, and start 2015. Under git-flow,
Expand Down
10 changes: 3 additions & 7 deletions spec/base-mixin-spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -213,13 +213,9 @@ describe("dc.baseMixin", function () {
expect(chart.anchor()).toEqual(anchorDiv);
});

it('should return a numeric string, when anchorName is called', 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]*/);
it('should return a valid, selectable id', function () {
// see http://stackoverflow.com/questions/70579/what-are-valid-values-for-the-id-attribute-in-html
expect(chart.anchorName()).toMatch(/^[a-zA-Z][a-zA-Z0-9_:.-]*$/);
});

});
Expand Down

0 comments on commit d20a75f

Please sign in to comment.