-
Notifications
You must be signed in to change notification settings - Fork 537
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Fix] Map extension with mcap files (#163)
**User-Facing Changes** This is a bug fix. Previoulsy, when loading a file and trying to load the Map panel there was an error being show. **Description** Due the past implementations some bug was introduced when loading the config object on Panel Extension Adapter. When forcing it to be initialized with 'initialState.current' the topics were not being loaded correctly. We also added some tests to verify that the Map panel is being loaded correctly. **Checklist** - [x] The web version was tested and it is running ok - [x] The desktop version was tested and it is running ok - [x] I've updated/created the storybook file(s)
- Loading branch information
1 parent
d51d02d
commit 4619bb5
Showing
3 changed files
with
45 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 |
---|---|---|
@@ -0,0 +1,43 @@ | ||
// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG)<[email protected]> | ||
// SPDX-License-Identifier: MPL-2.0 | ||
|
||
import path from "path"; | ||
|
||
import { AppType, launchApp } from "./launchApp"; | ||
|
||
describe("mapPanel", () => { | ||
const closeDataSourceDialogAfterAppLaunch = async (app: AppType) => { | ||
await expect(app.renderer.getByTestId("DataSourceDialog").isVisible()).resolves.toBe(true); | ||
await app.renderer.getByTestId("DataSourceDialog").getByTestId("CloseIcon").click(); | ||
await expect(app.renderer.getByTestId("DataSourceDialog").isVisible()).resolves.toBe(false); | ||
}; | ||
|
||
it("should open map panel when loading a file", async () => { | ||
await using app = await launchApp(); | ||
await closeDataSourceDialogAfterAppLaunch(app); | ||
//Add rosbag file from source | ||
const filePath = path.resolve( | ||
__dirname, | ||
"../../packages/suite-base/src/test/fixtures/example.bag", | ||
); | ||
//Drag and drop file | ||
const fileInput = app.renderer.locator("[data-puppeteer-file-upload]"); | ||
await fileInput.setInputFiles(filePath); | ||
|
||
//Click on add panel and select Map | ||
await app.renderer.getByTestId("AddPanelButton").click(); | ||
|
||
// Click on "Search panels" input field and type Map | ||
const searchInput = app.renderer.getByPlaceholder("Search panels"); | ||
// await searchInput.click(); | ||
await searchInput.type("Map"); | ||
await app.renderer.getByTestId("panel-menu-item Map").click(); | ||
|
||
const mapSettingsIcon = app.renderer.getByTestId("SettingsIcon").nth(0); | ||
await mapSettingsIcon.click(); | ||
|
||
await expect(app.renderer.getByText("Map panel", { exact: true }).innerText()).resolves.toBe( | ||
"Map panel", | ||
); | ||
}, 15_000); | ||
}); |
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