chore: More flakey test improvements (#5801)
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import randomstring from "randomstring";
|
||||
import { IntegrationService } from "@shared/types";
|
||||
import env from "@server/env";
|
||||
import { IntegrationAuthentication, SearchQuery } from "@server/models";
|
||||
@@ -17,7 +18,7 @@ jest.mock("../slack", () => ({
|
||||
const server = getTestServer();
|
||||
|
||||
describe("#hooks.unfurl", () => {
|
||||
it("should return documents", async () => {
|
||||
it("should return documents with matching SSO user", async () => {
|
||||
const user = await buildUser();
|
||||
const document = await buildDocument({
|
||||
userId: user.id,
|
||||
@@ -28,18 +29,19 @@ describe("#hooks.unfurl", () => {
|
||||
service: IntegrationService.Slack,
|
||||
userId: user.id,
|
||||
teamId: user.teamId,
|
||||
token: "",
|
||||
token: randomstring.generate(32),
|
||||
});
|
||||
|
||||
const res = await server.post("/api/hooks.unfurl", {
|
||||
body: {
|
||||
token: env.SLACK_VERIFICATION_TOKEN,
|
||||
team_id: "TXXXXXXXX",
|
||||
api_app_id: "AXXXXXXXXX",
|
||||
team_id: `T${randomstring.generate(8)}`,
|
||||
api_app_id: `A${randomstring.generate(8)}`,
|
||||
event: {
|
||||
type: "link_shared",
|
||||
channel: "Cxxxxxx",
|
||||
channel: `C${randomstring.generate(8)}`,
|
||||
user: user.authentications[0].providerId,
|
||||
message_ts: "123456789.9875",
|
||||
message_ts: randomstring.generate(12),
|
||||
links: [
|
||||
{
|
||||
domain: "getoutline.com",
|
||||
|
||||
Reference in New Issue
Block a user