[new feature] IndexBar: add sticky prop (#3402)

This commit is contained in:
neverland
2019-05-30 11:50:09 +08:00
committed by GitHub
parent 74124246f6
commit 82134fe402
14 changed files with 263 additions and 60 deletions
+13 -8
View File
@@ -1,12 +1,17 @@
import Demo from '../demo';
import demoTest from '../../../test/demo-test';
import { mockGetBoundingClientRect } from '../../../test/utils';
function mockGetBoundingClientRect(vertical) {
Element.prototype.getBoundingClientRect = jest.fn(() => ({
width: 100,
height: 100
}));
}
let restore;
mockGetBoundingClientRect();
demoTest(Demo);
demoTest(Demo, {
hookBeforeTest: () => {
restore = mockGetBoundingClientRect({
width: 100,
height: 100
});
},
hookAfterTest: () => {
restore();
}
});