Skip to content

Commit

Permalink
Merge pull request #1093 from jetstreamapp/chore/add-tests-for-frontd…
Browse files Browse the repository at this point in the history
…oor-login

Add tests for frontdoor login
  • Loading branch information
paustint authored Nov 23, 2024
2 parents 53e6da5 + 4bb9d5e commit dc4a724
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 5 deletions.
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

0 comments on commit dc4a724

Please sign in to comment.