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

Function expectInnerAlignment

test/specs/core.scale.tests.js:847–855  ·  view source on GitHub ↗
(items)

Source from the content-addressed store, hash-verified

845 }
846
847 function expectInnerAlignment(items) {
848 const first = items[0];
849 const last = items[items.length - 1];
850 expect(first.options.textAlign).toBe('left');
851 expect(first.options.backdrop.left).toBe(0);
852 expect(last.options.textAlign).toBe('right');
853 expect(last.options.backdrop.left).toBe(-last.options.backdrop.width);
854 items.slice(1, -1).forEach(item => expect(item.options.textAlign).toBe('center'));
855 }
856
857 it('should align the outermost labels inwards on a linear axis', () => {
858 expectInnerAlignment(getInnerLabels({type: 'linear', min: 200, max: 1000}, linearData));

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected