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