|
| 1 | +/* |
| 2 | + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one |
| 3 | + * or more contributor license agreements. Licensed under the Elastic License |
| 4 | + * 2.0 and the Server Side Public License, v 1; you may not use this file except |
| 5 | + * in compliance with, at your election, the Elastic License 2.0 or the Server |
| 6 | + * Side Public License, v 1. |
| 7 | + */ |
| 8 | + |
| 9 | +/// <reference types="cypress" /> |
| 10 | +/// <reference types="cypress-real-events" /> |
| 11 | +/// <reference types="../../../cypress/support" /> |
| 12 | + |
| 13 | +import React from 'react'; |
| 14 | + |
| 15 | +import { EuiHeader } from './header'; |
| 16 | +import { EuiFlyout } from '../flyout'; |
| 17 | + |
| 18 | +describe('EuiHeader', () => { |
| 19 | + describe('fixed position', () => { |
| 20 | + it('is above EuiFlyout', () => { |
| 21 | + cy.mount( |
| 22 | + <> |
| 23 | + <EuiHeader data-test-subj="header" position="fixed" /> |
| 24 | + <EuiFlyout data-test-subj="flyout" /> |
| 25 | + </> |
| 26 | + ); |
| 27 | + |
| 28 | + cy.get('[data-test-subj="flyout"]').then(($flyout) => { |
| 29 | + const styles = window.getComputedStyle($flyout[0]); |
| 30 | + const flyoutZIndex = parseInt(styles.getPropertyValue('z-index'), 10); |
| 31 | + |
| 32 | + cy.get('[data-test-subj="header"]') |
| 33 | + .should('have.css', 'z-index') |
| 34 | + .then((value) => parseInt(value, 10)) |
| 35 | + .and('be.above', flyoutZIndex); |
| 36 | + }); |
| 37 | + }); |
| 38 | + }); |
| 39 | +}); |
0 commit comments