-
Notifications
You must be signed in to change notification settings - Fork 83
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: include notification container into the overlay stack (#8198)
- Loading branch information
1 parent
ab28efb
commit 256ef92
Showing
7 changed files
with
83 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
import { expect } from '@vaadin/chai-plugins'; | ||
import { fixtureSync, nextRender } from '@vaadin/testing-helpers'; | ||
import '@vaadin/notification'; | ||
import '@vaadin/popover'; | ||
import '@vaadin/tooltip'; | ||
|
||
describe('notification and overlays', () => { | ||
describe('notification and tooltip', () => { | ||
beforeEach(async () => { | ||
const wrapper = fixtureSync(` | ||
<div> | ||
<vaadin-notification></vaadin-notification> | ||
<div id="target"></div> | ||
<vaadin-tooltip for="target" text="Tooltip" manual></vaadin-tooltip> | ||
</div> | ||
`); | ||
const notification = wrapper.querySelector('vaadin-notification'); | ||
const tooltip = wrapper.querySelector('vaadin-tooltip'); | ||
notification.opened = true; | ||
tooltip.opened = true; | ||
await nextRender(); | ||
}); | ||
|
||
it('should show tooltips above notifications', () => { | ||
const notificationContainer = document.querySelector('vaadin-notification-container'); | ||
const tooltipOverlay = document.querySelector('vaadin-tooltip-overlay'); | ||
|
||
const notificationZIndex = parseInt(getComputedStyle(notificationContainer).zIndex); | ||
const tooltipZIndex = parseInt(getComputedStyle(tooltipOverlay).zIndex); | ||
|
||
expect(tooltipZIndex).to.be.above(notificationZIndex); | ||
}); | ||
}); | ||
|
||
describe('notification and popover', () => { | ||
beforeEach(async () => { | ||
const wrapper = fixtureSync(` | ||
<div> | ||
<vaadin-notification></vaadin-notification> | ||
<div id="target"></div> | ||
<vaadin-popover for="target" manual></vaadin-popover> | ||
</div> | ||
`); | ||
const notification = wrapper.querySelector('vaadin-notification'); | ||
const popover = wrapper.querySelector('vaadin-popover'); | ||
popover.renderer = (root) => { | ||
root.textContent = 'Popover content'; | ||
}; | ||
notification.opened = true; | ||
popover.opened = true; | ||
await nextRender(); | ||
}); | ||
|
||
it('should show popovers above notifications', () => { | ||
const notificationContainer = document.querySelector('vaadin-notification-container'); | ||
const popoverOverlay = document.querySelector('vaadin-popover-overlay'); | ||
|
||
const notificationZIndex = parseInt(getComputedStyle(notificationContainer).zIndex); | ||
const popoverZIndex = parseInt(getComputedStyle(popoverOverlay).zIndex); | ||
|
||
expect(popoverZIndex).to.be.above(notificationZIndex); | ||
}); | ||
}); | ||
}); |
This file was deleted.
Oops, something went wrong.