EnxDev commented on code in PR #45827:
URL: https://github.com/apache/superset/pull/45827#discussion_r4405684478
##########
superset-frontend/src/dashboard/containers/DashboardPage.test.tsx:
##########
@@ -781,3 +781,35 @@ test('clears undo history after hydrating the dashboard',
async () => {
.invocationCallOrder[0];
expect(clearOrder).toBeGreaterThan(hydrateOrder);
});
+
+test('document.title falls back to the app name on unmount, not the title
present at mount', async () => {
+ // A direct page load of a dashboard URL arrives with the dashboard name
+ // already in <title>, so restoring the title seen at mount leaves the stale
+ // name in the tab after navigating away.
+ document.title = 'Test Dashboard';
Review Comment:
Nit, take it or leave it. The Explore version of this test saves and
restores `document.title` in a `try/finally`, but this one leaves the global
set to whatever the unmount wrote.
It's the last test in the file so nothing trips on it today, but the title
tests here already leak into each other when run with `-t "document.title"`, so
matching the Explore pattern would keep that from getting worse.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]