enterprise: fix license status progress bar (#11048)
* clamp width to 100% width Signed-off-by: Jens Langhammer <jens@goauthentik.io> * add case for unlicensed and set to infinity when users of a type exists that dont have licenses Signed-off-by: Jens Langhammer <jens@goauthentik.io> * rework license status into separate component... Signed-off-by: Jens Langhammer <jens@goauthentik.io> * enable coverage Signed-off-by: Jens Langhammer <jens@goauthentik.io> * remove annoying disable-search-engine-choice-screen Signed-off-by: Jens Langhammer <jens@goauthentik.io> * refactor percentage calculation Signed-off-by: Jens Langhammer <jens@goauthentik.io> * fix a bug found by tests, yay Signed-off-by: Jens Langhammer <jens@goauthentik.io> * add tests for enterprise status card Signed-off-by: Jens Langhammer <jens@goauthentik.io> * upgrade vite-tsconfig-paths Signed-off-by: Jens Langhammer <jens@goauthentik.io> * ...? Signed-off-by: Jens Langhammer <jens@goauthentik.io> --------- Signed-off-by: Jens Langhammer <jens@goauthentik.io>
This commit is contained in:
@ -17,11 +17,10 @@ describe("Search select: Test Input Field", () => {
|
||||
let select: AkSearchSelectViewDriver;
|
||||
|
||||
beforeEach(async () => {
|
||||
await render(
|
||||
render(
|
||||
html`<ak-search-select-view .options=${longGoodForYouPairs}> </ak-search-select-view>`,
|
||||
document.body,
|
||||
);
|
||||
// @ts-ignore
|
||||
select = await AkSearchSelectViewDriver.build(await $("ak-search-select-view"));
|
||||
});
|
||||
|
||||
@ -57,6 +56,7 @@ describe("Search select: Test Input Field", () => {
|
||||
expect(await select.open).toBe(false);
|
||||
expect(await select.menuIsVisible()).toBe(false);
|
||||
await browser.keys("A");
|
||||
select = await AkSearchSelectViewDriver.build(await $("ak-search-select-view"));
|
||||
expect(await select.open).toBe(true);
|
||||
expect(await select.menuIsVisible()).toBe(true);
|
||||
});
|
||||
@ -64,19 +64,19 @@ describe("Search select: Test Input Field", () => {
|
||||
it("should update the list as the user types", async () => {
|
||||
await select.focusOnInput();
|
||||
await browser.keys("Ap");
|
||||
expect(await select.menuIsVisible()).toBe(true);
|
||||
await expect(await select.menuIsVisible()).toBe(true);
|
||||
const elements = Array.from(await select.listElements());
|
||||
expect(elements.length).toBe(2);
|
||||
await expect(elements.length).toBe(2);
|
||||
});
|
||||
|
||||
it("set the value when a match is close", async () => {
|
||||
await select.focusOnInput();
|
||||
await browser.keys("Ap");
|
||||
expect(await select.menuIsVisible()).toBe(true);
|
||||
await expect(await select.menuIsVisible()).toBe(true);
|
||||
const elements = Array.from(await select.listElements());
|
||||
expect(elements.length).toBe(2);
|
||||
await expect(elements.length).toBe(2);
|
||||
await browser.keys(Key.Tab);
|
||||
expect(await (await select.input()).getValue()).toBe("Apples");
|
||||
await expect(await (await select.input()).getValue()).toBe("Apples");
|
||||
});
|
||||
|
||||
it("should close the menu when the user clicks away", async () => {
|
||||
@ -93,8 +93,8 @@ describe("Search select: Test Input Field", () => {
|
||||
});
|
||||
|
||||
afterEach(async () => {
|
||||
await document.body.querySelector("#a-separate-component")?.remove();
|
||||
await document.body.querySelector("ak-search-select-view")?.remove();
|
||||
document.body.querySelector("#a-separate-component")?.remove();
|
||||
document.body.querySelector("ak-search-select-view")?.remove();
|
||||
// @ts-expect-error expression of type '"_$litPart$"' is added by Lit
|
||||
if (document.body["_$litPart$"]) {
|
||||
// @ts-expect-error expression of type '"_$litPart$"' is added by Lit
|
||||
|
||||
Reference in New Issue
Block a user