Skip to content

Commit 4313e29

Browse files
committed
Adjust tests
1 parent 9134ef4 commit 4313e29

File tree

2 files changed

+8
-16
lines changed

2 files changed

+8
-16
lines changed

src/lib/__tests__/multiValued-test.js

+4-10
Original file line numberDiff line numberDiff line change
@@ -15,20 +15,14 @@ describe('multiValued Numeric', () => {
1515

1616
const rangeInputs = mount(
1717
<TestEditor {...{...fixtureProps, onUpdate: jest.fn(), plotly}}>
18-
<AxesNumeric attr="range[0]" defaultAxesTarget="xaxis" />
19-
<AxesNumeric attr="range[0]" defaultAxesTarget="yaxis" />
20-
<AxesNumeric attr="range[0]" defaultAxesTarget="allaxes" />
18+
<AxesNumeric attr="range[0]" />
2119
</TestEditor>
2220
).find(NumericInput);
2321

24-
expect(rangeInputs.length).toBe(3);
22+
expect(rangeInputs.length).toBe(1);
2523

26-
const xaxisRangeInput = rangeInputs.at(0);
27-
const yaxisRangeInput = rangeInputs.at(1);
28-
const allaxisRangeInput = rangeInputs.at(2);
24+
const allaxisRangeInput = rangeInputs.at(0);
2925

30-
expect(xaxisRangeInput.prop('value')).toBe(0);
31-
expect(yaxisRangeInput.prop('value')).toBe(-1);
3226
expect(allaxisRangeInput.prop('value')).toBe('');
3327
expect(allaxisRangeInput.prop('placeholder')).toBe(
3428
MULTI_VALUED_PLACEHOLDER
@@ -45,7 +39,7 @@ describe('multiValued Numeric', () => {
4539

4640
mount(
4741
<TestEditor {...{...fixtureProps, beforeUpdateLayout, plotly}}>
48-
<AxesNumeric attr="range[0]" defaultAxesTarget="allaxes" />
42+
<AxesNumeric attr="range[0]" />
4943
</TestEditor>
5044
)
5145
.find('.js-numeric-increase')

src/lib/__tests__/nestedContainerConnections-test.js

+4-6
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,7 @@ describe('Plot Connection', () => {
2020
);
2121
mount(
2222
<TestEditor {...{...fixtureProps, beforeUpdateLayout}}>
23-
<LayoutAxesNumeric
24-
label="Min"
25-
attr="range[0]"
26-
defaultAxesTarget="xaxis"
27-
/>
23+
<LayoutAxesNumeric label="Min" attr="range[0]" />
2824
</TestEditor>
2925
)
3026
.find('[attr="range[0]"]')
@@ -34,7 +30,9 @@ describe('Plot Connection', () => {
3430

3531
expect(beforeUpdateLayout).toBeCalled();
3632
const payload = beforeUpdateLayout.mock.calls[0][0];
37-
expect(payload).toEqual({update: {'xaxis.range[0]': 1}});
33+
expect(payload).toEqual({
34+
update: {'xaxis.range[0]': 0, 'yaxis.range[0]': 0, 'yaxis2.range[0]': 0},
35+
});
3836
});
3937

4038
it('can connect to layout when connected within trace context', () => {

0 commit comments

Comments
 (0)