Skip to content

Commit ce965cf

Browse files
committed
add hrName related plot schema tests
1 parent b194356 commit ce965cf

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed

shelly/plotlyjs/static/plotlyjs/tests/plotschema_test.js

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,4 +154,42 @@ describe('plot schema', function() {
154154
}
155155
);
156156
});
157+
158+
it('axis and bin attributes should have `human-readable name` field', function() {
159+
var HR_NAME = '_hrName';
160+
161+
assertPlotSchema(
162+
function(attr, attrName) {
163+
if(isValObject(attr) || !isPlainObject(attr)) return;
164+
165+
if(attrName === 'xbins') {
166+
expect(attr[HR_NAME]).toEqual('x_bins');
167+
}
168+
else if(attrName === 'ybins') {
169+
expect(attr[HR_NAME]).toEqual('y_bins');
170+
}
171+
else if(attrName === 'xaxis') {
172+
expect(attr[HR_NAME]).toEqual('x_axis');
173+
}
174+
else if(attrName === 'yaxis') {
175+
expect(attr[HR_NAME]).toEqual('y_axis');
176+
}
177+
else if(attrName === 'zaxis') {
178+
expect(attr[HR_NAME]).toEqual('z_axis');
179+
}
180+
else if(attrName === 'lonaxis') {
181+
expect(attr[HR_NAME]).toEqual('lon_axis');
182+
}
183+
else if(attrName === 'lataxis') {
184+
expect(attr[HR_NAME]).toEqual('lat_axis');
185+
}
186+
else if(attrName === 'radialaxis') {
187+
expect(attr[HR_NAME]).toEqual('radial_axis');
188+
}
189+
else if(attrName === 'angularaxis') {
190+
expect(attr[HR_NAME]).toEqual('angular_axis');
191+
}
192+
}
193+
)
194+
});
157195
});

0 commit comments

Comments
 (0)