| 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)); |