fix select component test (#485)

This commit is contained in:
Will Chen
2025-06-24 16:16:08 -07:00
committed by GitHub
parent 47f3ec460a
commit 87a0de438c
3 changed files with 19 additions and 3 deletions

View File

@@ -649,8 +649,22 @@ export class PageObject {
await this.page.getByRole("button", { name: "Open in Chat" }).click();
}
locateAppUpgradeButton({ upgradeId }: { upgradeId: string }) {
return this.page.getByTestId(`app-upgrade-${upgradeId}`);
}
async clickAppUpgradeButton({ upgradeId }: { upgradeId: string }) {
await this.page.getByTestId(`app-upgrade-${upgradeId}`).click();
await this.locateAppUpgradeButton({ upgradeId }).click();
}
async expectAppUpgradeButtonIsNotVisible({
upgradeId,
}: {
upgradeId: string;
}) {
await expect(this.locateAppUpgradeButton({ upgradeId })).toBeHidden({
timeout: Timeout.MEDIUM,
});
}
async expectNoAppUpgrades() {

View File

@@ -58,7 +58,9 @@ testSkipIfWindows("upgrade app to select component", async ({ po }) => {
await po.importApp("select-component");
await po.getTitleBarAppNameButton().click();
await po.clickAppUpgradeButton({ upgradeId: "component-tagger" });
await po.expectNoAppUpgrades();
await po.expectAppUpgradeButtonIsNotVisible({
upgradeId: "component-tagger",
});
await po.snapshotAppFiles();
await po.clickOpenInChatButton();
// There should be another version from the upgrade being committed.