-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* use taipy-assets favicon resolves #1327 allow to change favicon dynamically resolves #1244 * with doc * doc * test * Fab's comments * allow to change favicon for one state * fab's comments * favicon * mypy * trying to fix cross-env ... * trying to fix cross-env ... * trying to fix cross-env ... * do not run test if cache hit * noncoverage either if cache hit * class name --------- Co-authored-by: Fred Lefévère-Laoide <[email protected]>
- Loading branch information
1 parent
d68654c
commit 16e90fb
Showing
11 changed files
with
127 additions
and
23 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
Binary file not shown.
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
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
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,35 @@ | ||
# Copyright 2021-2024 Avaiga Private Limited | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with | ||
# the License. You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on | ||
# an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the | ||
# specific language governing permissions and limitations under the License. | ||
|
||
import inspect | ||
import warnings | ||
|
||
from taipy.gui import Gui, Markdown | ||
|
||
|
||
def test_favicon(gui: Gui, helpers): | ||
|
||
with warnings.catch_warnings(record=True): | ||
gui._set_frame(inspect.currentframe()) | ||
gui.add_page("test", Markdown("#This is a page")) | ||
gui.run(run_server=False) | ||
client = gui._server.test_client() | ||
# WS client and emit | ||
ws_client = gui._server._ws.test_client(gui._server.get_flask()) | ||
# Get the jsx once so that the page will be evaluated -> variable will be registered | ||
sid = helpers.create_scope_and_get_sid(gui) | ||
client.get(f"/taipy-jsx/test/?client_id={sid}") | ||
gui.set_favicon("https://newfavicon.com/favicon.png") | ||
# assert for received message (message that would be sent to the front-end client) | ||
msgs = ws_client.get_received() | ||
assert msgs | ||
assert msgs[0].get("args", {}).get("type", None) == "FV" | ||
assert msgs[0].get("args", {}).get("payload", {}).get("value", None) == "https://newfavicon.com/favicon.png" |