0
Fork 0
mirror of https://github.com/logto-io/logto.git synced 2024-12-30 20:33:54 -05:00

fix(console): always display create org button (#5746)

This commit is contained in:
Xiao Yijun 2024-04-18 16:15:05 +08:00 committed by GitHub
parent c1c746bca4
commit c6adedefb5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 9 additions and 10 deletions

View file

@ -81,7 +81,7 @@ function Organizations({ tab }: Props) {
targetBlank: 'noopener',
}}
/>
{!isInitialSetup && (
{(!isInitialSetup || isDevFeaturesEnabled) && (
<Button
icon={<Plus />}
type="primary"

View file

@ -3,12 +3,12 @@ import { cls, dcls, generateTestName } from '#src/utils.js';
const expectOrg = new ExpectOrganizations(await browser.newPage());
// Temporarily skipping organization tests, will add them back later with the "guide" feature
describe.skip('organizations: create, edit, and delete organization', () => {
it('navigates to organizations page', async () => {
// Start the test by signing in or starting the console
await expectOrg.start();
describe('organizations: create, edit, and delete organization', () => {
it('navigates to organizations page', async () => {
await expectOrg.gotoPage('/organizations', 'Organizations');
await expectOrg.toExpectTabs('Organizations', 'Settings');
});
it('should be able to see the table', async () => {
@ -40,18 +40,17 @@ describe.skip('organizations: create, edit, and delete organization', () => {
undefined,
false
);
await expectOrg.toClick(`${dcls('danger')}[role=menuitem]`, 'Delete organization', false);
await expectOrg.toClick(`${dcls('danger')}[role=menuitem]`, 'Delete', false);
await expectOrg.toExpectModal('Reminder');
await expectOrg.toClick(['.ReactModalPortal', `button${cls('danger')}`].join(' '), 'Delete');
expectOrg.toMatchUrl(/\/organizations$/);
});
});
describe.skip('organizations: search organization', () => {
describe('organizations: search organization', () => {
const [testName1, testName2] = [generateTestName(), generateTestName()];
it('creates two organizations', async () => {
await expectOrg.start();
await expectOrg.toCreateOrganization(testName1);
await expectOrg.toCreateOrganization(testName2);
await expectOrg.gotoPage('/organizations', 'Organizations');

View file

@ -12,13 +12,13 @@ export default class ExpectOrganizations extends ExpectConsole {
*/
async toCreateOrganization(name: string) {
await this.gotoPage('/organizations', 'Organizations');
await this.toClickButton('Create organization');
await this.toClickButton('Create organization', false);
await this.toExpectModal('Create organization');
await this.toFillForm({
name,
});
await this.toClick(['.ReactModalPortal', `button${cls('primary')}`].join(' '), 'Create', false);
await this.toClick(['.ReactModalPortal', `button${cls('primary')}`].join(' '), 'Create');
this.toMatchUrl(/\/organizations\/.+$/);
}