-
Notifications
You must be signed in to change notification settings - Fork 70
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(core/message): add options to set size and position (#1533)
Co-authored-by: Daniel Leroux <[email protected]>
- Loading branch information
1 parent
19b6842
commit 3e2835f
Showing
19 changed files
with
122 additions
and
28 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@siemens/ix": minor | ||
--- | ||
|
||
feat(core/message): add options to set size and position |
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,69 @@ | ||
/* | ||
* SPDX-FileCopyrightText: 2024 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'; | ||
import { showMessage } from 'src/components/utils/modal/message'; | ||
import { IxModalSize } from 'src/components'; | ||
|
||
declare global { | ||
interface Window { | ||
showMessage: typeof showMessage; | ||
} | ||
} | ||
|
||
const screenWidths: IxModalSize[] = [ | ||
`360`, | ||
`480`, | ||
`600`, | ||
`720`, | ||
`840`, | ||
`full-width`, | ||
`full-screen`, | ||
]; | ||
|
||
screenWidths.forEach((size) => { | ||
test(`message size ${size}`, async ({ page, mount }) => { | ||
await mount(``); | ||
|
||
await page.evaluate(() => { | ||
return new Promise<void>((resolve) => { | ||
const script = document.createElement('script'); | ||
script.type = 'module'; | ||
script.innerHTML = ` | ||
import * as ix from 'http://127.0.0.1:8080/www/build/index.esm.js'; | ||
window.showMessage = ix.showMessage; | ||
`; | ||
|
||
document.body.appendChild(script); | ||
resolve(); | ||
}); | ||
}); | ||
|
||
await page.waitForTimeout(500); | ||
|
||
await page.evaluate( | ||
({ size }) => { | ||
window.showMessage({ | ||
messageTitle: 'Example title', | ||
message: 'message', | ||
icon: 'info', | ||
size: size, | ||
centered: true, | ||
actions: [], | ||
}); | ||
}, | ||
{ size } | ||
); | ||
|
||
await page.waitForTimeout(500); | ||
|
||
expect(await page.screenshot({ fullPage: true })).toMatchSnapshot(); | ||
}); | ||
}); |
Binary file added
BIN
+12.6 KB
...age.e2e.ts-snapshots/message-size-360-1-chromium---theme-classic-dark-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+12 KB
...ge.e2e.ts-snapshots/message-size-360-1-chromium---theme-classic-light-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+12.7 KB
...age.e2e.ts-snapshots/message-size-480-1-chromium---theme-classic-dark-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+12.1 KB
...ge.e2e.ts-snapshots/message-size-480-1-chromium---theme-classic-light-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+12.7 KB
...age.e2e.ts-snapshots/message-size-600-1-chromium---theme-classic-dark-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+12 KB
...ge.e2e.ts-snapshots/message-size-600-1-chromium---theme-classic-light-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+12.7 KB
...age.e2e.ts-snapshots/message-size-720-1-chromium---theme-classic-dark-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+12 KB
...ge.e2e.ts-snapshots/message-size-720-1-chromium---theme-classic-light-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+12.7 KB
...age.e2e.ts-snapshots/message-size-840-1-chromium---theme-classic-dark-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+12 KB
...ge.e2e.ts-snapshots/message-size-840-1-chromium---theme-classic-light-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+10.3 KB
...ts-snapshots/message-size-full-screen-1-chromium---theme-classic-dark-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+10.2 KB
...s-snapshots/message-size-full-screen-1-chromium---theme-classic-light-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+12.6 KB
....ts-snapshots/message-size-full-width-1-chromium---theme-classic-dark-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+12 KB
...ts-snapshots/message-size-full-width-1-chromium---theme-classic-light-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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