mirror of
https://github.com/grafana/grafana.git
synced 2025-08-02 06:22:35 +08:00
New Select: Try it out with some core components (#92826)
* Export Combobox and add portalling * Use floatingui fixed strategy and fix z-index * Check non null * Make value string type only * Try with fiscal year setting * Use combobox for WeekStartPicker * Improve screen reader handling * Fix faulty import * Fix type issue * Fix failing tests and export unstable * Rename option and remove export * Use comboboxMockSetup function * Add support for number type * menuClosed styles to emotion
This commit is contained in:
17
public/test/helpers/comboboxTestSetup.ts
Normal file
17
public/test/helpers/comboboxTestSetup.ts
Normal file
@ -0,0 +1,17 @@
|
||||
/**
|
||||
* Needed for Combobox virtual list. The numbers are arbitrary and just need to be consistent.
|
||||
*/
|
||||
export const comboboxTestSetup = () => {
|
||||
const mockGetBoundingClientRect = jest.fn(() => ({
|
||||
width: 120,
|
||||
height: 120,
|
||||
top: 0,
|
||||
left: 0,
|
||||
bottom: 0,
|
||||
right: 0,
|
||||
}));
|
||||
|
||||
Object.defineProperty(Element.prototype, 'getBoundingClientRect', {
|
||||
value: mockGetBoundingClientRect,
|
||||
});
|
||||
};
|
Reference in New Issue
Block a user