Files
backstage/.changeset/plenty-students-check.md
T
Camila Belo af9097e1c0 feat: support matches per breakpoints
Signed-off-by: Camila Belo <camilaibs@gmail.com>
2024-10-18 14:25:14 +02:00

545 B

@backstage/core-components
@backstage/core-components
patch

Adds the ability to mock a media query per break point and to change the active break point during a test. Usage example:

const { set } = mockBreakpoint({
  initialBreakpoint: 'md',
  queryBreakpointMap: {
    '(min-width:1500px)': 'xl',
    '(min-width:1000px)': 'lg',
    '(min-width:700px)': 'md',
    '(min-width:400px)': 'sm',
    '(min-width:0px)': 'xs',
  },
});
// assertions for when the active break point is "md"
set('lg');
// assertions for when the active break point is "lg"