tenants: add tests
Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
This commit is contained in:
@ -92,7 +92,7 @@ export class TenantForm extends ModelForm<Tenant, string> {
|
||||
designation: FlowsInstancesListDesignationEnum.Authentication,
|
||||
}).then(flows => {
|
||||
return flows.results.map(flow => {
|
||||
let selected = this.instance?.flowAuthentication === flow.pk;
|
||||
const selected = this.instance?.flowAuthentication === flow.pk;
|
||||
return html`<option value=${flow.pk} ?selected=${selected}>${flow.name} (${flow.slug})</option>`;
|
||||
});
|
||||
}), html`<option>${t`Loading...`}</option>`)}
|
||||
@ -109,7 +109,7 @@ export class TenantForm extends ModelForm<Tenant, string> {
|
||||
designation: FlowsInstancesListDesignationEnum.Invalidation,
|
||||
}).then(flows => {
|
||||
return flows.results.map(flow => {
|
||||
let selected = this.instance?.flowInvalidation === flow.pk;
|
||||
const selected = this.instance?.flowInvalidation === flow.pk;
|
||||
return html`<option value=${flow.pk} ?selected=${selected}>${flow.name} (${flow.slug})</option>`;
|
||||
});
|
||||
}), html`<option>${t`Loading...`}</option>`)}
|
||||
@ -126,7 +126,7 @@ export class TenantForm extends ModelForm<Tenant, string> {
|
||||
designation: FlowsInstancesListDesignationEnum.Recovery,
|
||||
}).then(flows => {
|
||||
return flows.results.map(flow => {
|
||||
let selected = this.instance?.flowRecovery === flow.pk;
|
||||
const selected = this.instance?.flowRecovery === flow.pk;
|
||||
return html`<option value=${flow.pk} ?selected=${selected}>${flow.name} (${flow.slug})</option>`;
|
||||
});
|
||||
}), html`<option>${t`Loading...`}</option>`)}
|
||||
@ -143,7 +143,7 @@ export class TenantForm extends ModelForm<Tenant, string> {
|
||||
designation: FlowsInstancesListDesignationEnum.Recovery,
|
||||
}).then(flows => {
|
||||
return flows.results.map(flow => {
|
||||
let selected = this.instance?.flowUnenrollment === flow.pk;
|
||||
const selected = this.instance?.flowUnenrollment === flow.pk;
|
||||
return html`<option value=${flow.pk} ?selected=${selected}>${flow.name} (${flow.slug})</option>`;
|
||||
});
|
||||
}), html`<option>${t`Loading...`}</option>`)}
|
||||
|
||||
@ -8,7 +8,6 @@ import PFForm from "@patternfly/patternfly/components/Form/form.css";
|
||||
import PFFormControl from "@patternfly/patternfly/components/FormControl/form-control.css";
|
||||
import { CoreApi, User } from "authentik-api";
|
||||
import { me } from "../../api/Users";
|
||||
import { FlowURLManager } from "../../api/legacy";
|
||||
import { ifDefined } from "lit-html/directives/if-defined";
|
||||
import { DEFAULT_CONFIG, tenant } from "../../api/Config";
|
||||
import "../../elements/forms/FormElement";
|
||||
|
||||
Reference in New Issue
Block a user