Merge pull request #3932 from bluewave-labs/fix/test-all-admin-guard
fix: add admin guard to test all button, fix tests
This commit is contained in:
2 files changed
+5
-3
No files matched your search
@@ -60,6 +60,7 @@ export const HeaderMonitorControls = ({
|
|||||||
direction={{ xs: "column", md: "row" }}
|
direction={{ xs: "column", md: "row" }}
|
||||||
gap={theme.spacing(2)}
|
gap={theme.spacing(2)}
|
||||||
>
|
>
|
||||||
|
{isAdmin && (
|
||||||
<Button
|
<Button
|
||||||
variant="contained"
|
variant="contained"
|
||||||
color="secondary"
|
color="secondary"
|
||||||
@@ -74,6 +75,7 @@ export const HeaderMonitorControls = ({
|
|||||||
>
|
>
|
||||||
{t("common.buttons.testNotifications")}
|
{t("common.buttons.testNotifications")}
|
||||||
</Button>
|
</Button>
|
||||||
|
)}
|
||||||
<Button
|
<Button
|
||||||
variant="contained"
|
variant="contained"
|
||||||
color="secondary"
|
color="secondary"
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ describe("isAllowed middleware", () => {
|
|||||||
const middleware = isAllowed(["admin", "superadmin"]);
|
const middleware = isAllowed(["admin", "superadmin"]);
|
||||||
const req = {
|
const req = {
|
||||||
user: {
|
user: {
|
||||||
userId: "user-1",
|
id: "user-1",
|
||||||
teamId: "team-1",
|
teamId: "team-1",
|
||||||
email: "admin@example.com",
|
email: "admin@example.com",
|
||||||
role: ["admin"],
|
role: ["admin"],
|
||||||
@@ -26,7 +26,7 @@ describe("isAllowed middleware", () => {
|
|||||||
const middleware = isAllowed(["admin", "superadmin"]);
|
const middleware = isAllowed(["admin", "superadmin"]);
|
||||||
const req = {
|
const req = {
|
||||||
user: {
|
user: {
|
||||||
userId: "user-2",
|
id: "user-2",
|
||||||
teamId: "team-1",
|
teamId: "team-1",
|
||||||
email: "user@example.com",
|
email: "user@example.com",
|
||||||
role: ["user"],
|
role: ["user"],
|
||||||
@@ -63,7 +63,7 @@ describe("isAllowed middleware", () => {
|
|||||||
const middleware = isAllowed(["admin", "superadmin"]);
|
const middleware = isAllowed(["admin", "superadmin"]);
|
||||||
const req = {
|
const req = {
|
||||||
user: {
|
user: {
|
||||||
userId: "user-3",
|
id: "user-3",
|
||||||
teamId: "team-1",
|
teamId: "team-1",
|
||||||
email: "multi@example.com",
|
email: "multi@example.com",
|
||||||
role: ["user", "admin"],
|
role: ["user", "admin"],
|
||||||
|
|||||||
Reference in new issue
Block a user