Skip to content

Commit f33f841

Browse files
committed
fix: simulate parent width for active bar
1 parent e551d12 commit f33f841

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

tests/range-align.spec.tsx

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,13 @@ describe('the popup arrow should be placed in the correct position.', () => {
7474
offsetParent: {
7575
get: () => document.body,
7676
},
77+
offsetWidth: {
78+
get() {
79+
if (this.tagName === 'BODY') {
80+
return 200;
81+
}
82+
},
83+
},
7784
});
7885
});
7986

@@ -123,7 +130,11 @@ describe('the popup arrow should be placed in the correct position.', () => {
123130
await Promise.resolve();
124131
});
125132
expect(document.querySelector('.rc-picker-range-arrow')).toHaveStyle({
126-
'inset-inline-end': '0',
133+
'inset-inline-end': '100px',
134+
});
135+
136+
expect(document.querySelector('.rc-picker-active-bar')).toHaveStyle({
137+
'inset-inline-end': '100px',
127138
});
128139

129140
mock.mockRestore();

0 commit comments

Comments
 (0)