-
Notifications
You must be signed in to change notification settings - Fork 77
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(core/message-bar): hide entire
ix-message-bar
and turn off user…
…-interactions (#1695)
- Loading branch information
1 parent
8726afc
commit 5cdd5e8
Showing
3 changed files
with
39 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -58,4 +58,8 @@ | |
ix-icon { | ||
margin-top: $tiny-space; | ||
} | ||
|
||
.message-bar-hidden { | ||
display: none; | ||
} | ||
} |
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
34 changes: 34 additions & 0 deletions
34
packages/core/src/components/message-bar/test/message-bar.ct.ts
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,34 @@ | ||
/* | ||
* SPDX-FileCopyrightText: 2025 Siemens AG | ||
* | ||
* SPDX-License-Identifier: MIT | ||
* | ||
* This source code is licensed under the MIT license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
*/ | ||
|
||
import { expect } from '@playwright/test'; | ||
import { test } from '@utils/test'; | ||
|
||
test.describe('ix-message-bar', () => { | ||
test.beforeEach(async ({ mount }) => { | ||
await mount( | ||
`<ix-message-bar type="danger" dismissible>Content</ix-message-bar>` | ||
); | ||
}); | ||
|
||
test('emits closeAnimationCompleted event', async ({ page }) => { | ||
const messageBar = page.locator('ix-message-bar'); | ||
const closeButton = messageBar.locator('[data-testid="close-btn"]'); | ||
|
||
const onCloseAnimationCompleted = messageBar.evaluate((element) => { | ||
return new Promise<void>((resolve) => { | ||
element.addEventListener('closeAnimationCompleted', () => resolve()); | ||
}); | ||
}); | ||
await closeButton.click(); | ||
await onCloseAnimationCompleted; | ||
|
||
await expect(messageBar).not.toBeVisible(); | ||
}); | ||
}); |