mirror of
https://github.com/wassname/talk.git
synced 2026-08-18 12:30:39 +08:00
[CORL-155] User Suspending and Banning (#2247)
* feat: suspending, banning, now propogation * feat: adapting to `now` * feat: support auth for suspension/banned * feat: added trace-id to requests * feat: new mutation api with hooks support * feat: added user status filtering, current field * feat: Implement filter by status, adapt to new USER_STATUS type, add lookup helper <3 * fix: typo * fix: tests * chore: rename banned status to ban status * test: feature test + lots of test helper improvements e.g. types * fix: add translation to ban user modal * fix: translation * fix: test
This commit is contained in:
@@ -29,7 +29,7 @@ async function createTestRenderer(
|
||||
.stub()
|
||||
.returns(
|
||||
merge(
|
||||
{ ...users[0], email: "", username: "", profiles: [] },
|
||||
{ ...users.admins[0], email: "", username: "", profiles: [] },
|
||||
get(customResolver, "Query.viewer")
|
||||
)
|
||||
),
|
||||
|
||||
@@ -25,7 +25,7 @@ async function createTestRenderer(
|
||||
settings: sinon
|
||||
.stub()
|
||||
.returns(merge({}, settings, get(customResolver, "Query.settings"))),
|
||||
viewer: sinon.stub().returns({ ...users[0], email: "" }),
|
||||
viewer: sinon.stub().returns({ ...users.admins[0], email: "" }),
|
||||
},
|
||||
};
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@ async function createTestRenderer(
|
||||
settings: sinon
|
||||
.stub()
|
||||
.returns(merge({}, settings, get(customResolver, "Query.settings"))),
|
||||
viewer: sinon.stub().returns({ ...users[0], profiles: [] }),
|
||||
viewer: sinon.stub().returns({ ...users.admins[0], profiles: [] }),
|
||||
},
|
||||
};
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@ const resolvers = {
|
||||
settings: sinon.stub().returns(settings),
|
||||
moderationQueues: sinon.stub().returns(emptyModerationQueues),
|
||||
comments: sinon.stub().returns(emptyRejectedComments),
|
||||
viewer: sinon.stub().returns(users[0]),
|
||||
viewer: sinon.stub().returns(users.admins[0]),
|
||||
},
|
||||
};
|
||||
|
||||
|
||||
@@ -32,7 +32,7 @@ function createTestRenderer(
|
||||
settings: sinon.stub().returns(settings),
|
||||
moderationQueues: sinon.stub().returns(emptyModerationQueues),
|
||||
comments: sinon.stub().returns(emptyRejectedComments),
|
||||
viewer: sinon.stub().returns({ ...users[0], ...userDiff }),
|
||||
viewer: sinon.stub().returns({ ...users.admins[0], ...userDiff }),
|
||||
},
|
||||
};
|
||||
const { testRenderer, context } = create({
|
||||
|
||||
@@ -21,7 +21,7 @@ const resolvers = {
|
||||
settings: sinon.stub().returns(settings),
|
||||
moderationQueues: sinon.stub().returns(emptyModerationQueues),
|
||||
comments: sinon.stub().returns(emptyRejectedComments),
|
||||
viewer: sinon.stub().returns(users[0]),
|
||||
viewer: sinon.stub().returns(users.admins[0]),
|
||||
},
|
||||
};
|
||||
|
||||
@@ -47,7 +47,7 @@ it("logs out", async () => {
|
||||
.returns({});
|
||||
|
||||
const userMenu = await waitForElement(() =>
|
||||
within(testRenderer.root).getByText(users[0].username, {
|
||||
within(testRenderer.root).getByText(users.admins[0].username!, {
|
||||
selector: "button",
|
||||
})
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user