mirror of
https://github.com/outline/outline.git
synced 2026-11-20 21:23:06 +03:00
* chore: Prune redundant comments and normalize lint directives Removes comments that restate the following line and stale TODOs, drops the passive event listener feature check now that all supported browsers support it, and renames eslint directives to oxlint. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BehTjuZwKbN5csMCp3H4QH * fix: Evaluate restricted team domains at validation time The restricted email provider list was captured when the model loaded, so it could not follow the hosting environment and the tests that covered it never reached the model. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BehTjuZwKbN5csMCp3H4QH * chore: Replace type suppressions with accurate types Adds a Concrete helper type for registries of abstract classes, declares missing Sequelize and refractor typings, uses public ProseMirror APIs, a typed mock context helper in middleware tests, and a StaticLink component for sidebar rows being edited. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BehTjuZwKbN5csMCp3H4QH --------- Co-authored-by: Claude <noreply@anthropic.com>
70 lines
1.8 KiB
TypeScript
70 lines
1.8 KiB
TypeScript
import { buildAdmin, buildTeam } from "@server/test/factories";
|
|
import TeamDomain from "./TeamDomain";
|
|
|
|
describe("TeamDomain", () => {
|
|
describe("create", () => {
|
|
it("should allow creation of domains", async () => {
|
|
const team = await buildTeam();
|
|
const user = await buildAdmin({ teamId: team.id });
|
|
const domain = await TeamDomain.create({
|
|
teamId: team.id,
|
|
name: "getoutline.com",
|
|
createdById: user.id,
|
|
});
|
|
|
|
expect(domain.name).toEqual("getoutline.com");
|
|
});
|
|
|
|
it("should not allow junk domains", async () => {
|
|
const team = await buildTeam();
|
|
const user = await buildAdmin({ teamId: team.id });
|
|
|
|
let error;
|
|
try {
|
|
await TeamDomain.create({
|
|
teamId: team.id,
|
|
name: "sdfsdf",
|
|
createdById: user.id,
|
|
});
|
|
} catch (err) {
|
|
error = err;
|
|
}
|
|
expect(error).toBeDefined();
|
|
});
|
|
|
|
it("should not allow creation of domains within restricted list", async () => {
|
|
const team = await buildTeam();
|
|
const user = await buildAdmin({ teamId: team.id });
|
|
|
|
let error;
|
|
try {
|
|
await TeamDomain.create({
|
|
teamId: team.id,
|
|
name: "gmail.com",
|
|
createdById: user.id,
|
|
});
|
|
} catch (err) {
|
|
error = err;
|
|
}
|
|
expect(error).toBeDefined();
|
|
});
|
|
|
|
it("should ignore casing and spaces when creating domains", async () => {
|
|
const team = await buildTeam();
|
|
const user = await buildAdmin({ teamId: team.id });
|
|
|
|
let error;
|
|
try {
|
|
await TeamDomain.create({
|
|
teamId: team.id,
|
|
name: " GMail.com ",
|
|
createdById: user.id,
|
|
});
|
|
} catch (err) {
|
|
error = err;
|
|
}
|
|
expect(error).toBeDefined();
|
|
});
|
|
});
|
|
});
|