keycloak-scim/js/libs/keycloak-admin-client/test/userStorageProvider.spec.ts
dependabot[bot] 97727dbed5
Bump @faker-js/faker from 9.0.3 to 9.1.0 (#34377)
* Bump @faker-js/faker from 9.0.3 to 9.1.0

Bumps [@faker-js/faker](https://github.com/faker-js/faker) from 9.0.3 to 9.1.0.
- [Release notes](https://github.com/faker-js/faker/releases)
- [Changelog](https://github.com/faker-js/faker/blob/next/CHANGELOG.md)
- [Commits](https://github.com/faker-js/faker/compare/v9.0.3...v9.1.0)

---
updated-dependencies:
- dependency-name: "@faker-js/faker"
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* removed use of deprecated userName()

Signed-off-by: Erik Jan de Wit <erikjan.dewit@gmail.com>

---------

Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: Erik Jan de Wit <erikjan.dewit@gmail.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Erik Jan de Wit <erikjan.dewit@gmail.com>
2024-10-30 12:14:02 +01:00

54 lines
1.4 KiB
TypeScript

// tslint:disable:no-unused-expression
import { faker } from "@faker-js/faker";
import * as chai from "chai";
import { KeycloakAdminClient } from "../src/client.js";
import type ComponentRepresentation from "../src/defs/componentRepresentation.js";
import { credentials } from "./constants.js";
const expect = chai.expect;
describe("Users federation provider", () => {
let kcAdminClient: KeycloakAdminClient;
let currentUserFed: ComponentRepresentation;
before(async () => {
kcAdminClient = new KeycloakAdminClient();
await kcAdminClient.auth(credentials);
const name = faker.internet.username();
currentUserFed = await kcAdminClient.components.create({
name,
parentId: "master",
providerId: "ldap",
providerType: "org.keycloak.storage.UserStorageProvider",
config: {
editMode: ["READ_ONLY"],
},
});
});
after(async () => {
await kcAdminClient.components.del({
id: currentUserFed.id!,
});
});
it("list storage provider", async () => {
const name = await kcAdminClient.userStorageProvider.name({
id: currentUserFed.id!,
});
expect(name).to.be.ok;
});
it("remove imported users", async () => {
await kcAdminClient.userStorageProvider.removeImportedUsers({
id: currentUserFed.id!,
});
});
it("unlink users", async () => {
await kcAdminClient.userStorageProvider.unlinkUsers({
id: currentUserFed.id!,
});
});
});