Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add tests for frontdoor login #1093

Merged
merged 1 commit into from
Nov 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion apps/jetstream-e2e/playwright.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ export default defineConfig({
},
testMatch: /.*\.spec\.ts/,
dependencies: ['setup'],
teardown: 'teardown',
// teardown: 'teardown',
},

// {
Expand Down
5 changes: 2 additions & 3 deletions apps/jetstream-e2e/src/pageObjectModels/OrganizationsPage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,12 +77,11 @@ export class OrganizationsPage {

try {
const allowLocator = salesforcePage.getByRole('button', { name: 'Allow' });
await expect(allowLocator).toBeVisible({ timeout: 1000 });
await allowLocator.waitFor({ state: 'visible', timeout: 20000 });
await allowLocator.click();
} catch {
// ignore error - this is expected if the org is already authorized
// ignore error - this is expected if the org has already consented
}

await pageClosePromise;
}

Expand Down
9 changes: 9 additions & 0 deletions apps/jetstream-e2e/src/tests/orgs/orgs.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,15 @@ test.describe('Salesforce Orgs + Jetstream Orgs', () => {
await expect(organizationsPage.orgDropdown).toHaveValue(environment.TEST_ORG_2);
});

await test.step('Ensure frontdoor login works', async () => {
await page.getByPlaceholder('Select an Org').click();
await page.getByTestId('header').getByTestId('org-info-popover-button').click();
await page.getByRole('link', { name: 'Setup Menu' }).click();
const salesforcePage = await page.waitForEvent('popup');
await salesforcePage.getByRole('tab', { name: 'Object Manager' }).click();
await salesforcePage.close();
});

await test.step('Add an org with a custom domain', async () => {
await organizationsPage.addSalesforceOrg(environment.TEST_ORG_3, environment.E2E_LOGIN_PASSWORD, {
type: 'custom',
Expand Down
1 change: 1 addition & 0 deletions libs/shared/ui-core/src/orgs/OrgInfoPopover.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -353,6 +353,7 @@ export const OrgInfoPopover: FunctionComponent<OrgInfoPopoverProps> = ({
}
buttonProps={{
className: iconButtonClassName || 'slds-button slds-button_icon',
'data-testid': 'org-info-popover-button',
}}
>
<Icon type="utility" icon="settings" className="slds-button__icon slds-current-color" omitContainer {...dropdownIconProps} />
Expand Down
2 changes: 1 addition & 1 deletion libs/ui/src/lib/popover/Popover.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export interface PopoverProps {
header?: JSX.Element;
footer?: JSX.Element;
panelStyle?: CSSProperties;
buttonProps: React.HTMLProps<HTMLButtonElement> & { as?: string };
buttonProps: React.HTMLProps<HTMLButtonElement> & { as?: string; 'data-testid'?: string };
panelProps?: Omit<React.HTMLProps<HTMLDivElement>, 'children' | 'className' | 'as' | 'refName' | 'onKeyDown'>;
buttonStyle?: CSSProperties;
size?: SmallMediumLarge | sizeXLarge | FullWidth;
Expand Down