8000 make histogram bins work with date strings by alexcjohnson · Pull Request #1150 · plotly/plotly.js · GitHub
[go: up one dir, main page]

Skip to content

make histogram bins work with date strings #1150

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Nov 15, 2016
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
update histogram supplyDefaults test because it's not doing as much
  • Loading branch information
alexcjohnson committed Nov 15, 2016
commit 4e0490f10f5b0add77bba44479d36dfeca4c0182
15 changes: 9 additions & 6 deletions test/jasmine/tests/histogram_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,10 @@ describe('Test histogram', function() {

});

it('should set autobinx to false if xbins is supplied and true if not', function() {
// coercing bin attributes got moved to calc because it needs
// axis type - so here we just test that it's NOT happening

it('should not coerce autobinx regardless of xbins', function() {
traceIn = {
x: [1, 2, 2],
xbins: {
Expand All @@ -94,16 +97,16 @@ describe('Test histogram', function() {
}
};
supplyDefaults(traceIn, traceOut);
expect(traceOut.autobinx).toBe(false);
expect(traceOut.autobinx).toBeUndefined();

traceIn = {
x: [1, 2, 2]
};
supplyDefaults(traceIn, traceOut);
expect(traceOut.autobinx).toBe(true);
expect(traceOut.autobinx).toBeUndefined();
});

it('should set autobiny to false if ybins is supplied and true if not', function() {
it('should not coerce autobiny regardless of ybins', function() {
traceIn = {
y: [1, 2, 2],
ybins: {
Expand All @@ -113,13 +116,13 @@ describe('Test histogram', function() {
}
};
supplyDefaults(traceIn, traceOut);
expect(traceOut.autobiny).toBe(false);
expect(traceOut.autobiny).toBeUndefined();

traceIn = {
y: [1, 2, 2]
};
supplyDefaults(traceIn, traceOut);
expect(traceOut.autobiny).toBe(true);
expect(traceOut.autobiny).toBeUndefined();
});

});
Expand Down
0