MCPcopy Create free account
hub / github.com/chartjs/Chart.js / expectInnerAlignment

Function expectInnerAlignment

test/specs/core.scale.spec.js:928–936  ·  view source on GitHub ↗
(items)

Source from the content-addressed store, hash-verified

926 }
927
928 function expectInnerAlignment(items) {
929 const first = items[0];
930 const last = items[items.length - 1];
931 expect(first.options.textAlign).toBe('left');
932 expect(first.options.backdrop.left).toBe(0);
933 expect(last.options.textAlign).toBe('right');
934 expect(last.options.backdrop.left).toBe(-last.options.backdrop.width);
935 items.slice(1, -1).forEach(item => expect(item.options.textAlign).toBe('center'));
936 }
937
938 it('should align the outermost labels inwards on a linear axis', () => {
939 expectInnerAlignment(getInnerLabels({type: 'linear', min: 200, max: 1000}, linearData));

Callers 1

core.scale.spec.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected