mirror of
https://github.com/Portabase/portabase.git
synced 2026-07-14 11:16:13 +02:00
feat: Add Microsoft Teams as notification provider (issue 260) (#313)
* feat: add Microsoft Teams notification provider * feat: Add Microsoft Teams as notification provider * fix: Update database migration * fix: Remove duplicate file 0058 db migration * add Microsoft Teams notification provider E2E tests * fix: externalize e2e testings and profile name trim (#318) * fix: externalize e2e testings * fix: externalize e2e tests. * refactor: improve e2e workflow. * chore: upgrade workflow action version. * fix: createEnv by adding emptyStringAsUndefined (#317) * chore: release 1.18.2 --------- Co-authored-by: killian-larcher <killian.larcher@soluce-technologies.com> Co-authored-by: Charles GTE <charles.gauthereau@soluce-technologies.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> * fix(layout): guard undefined user.name in avatar fallbacks (#320) * fix(layout): guard undefined user.name in avatar fallbacks * fix: AUTH_DEFAULT_USER as zod email --------- Co-authored-by: charles-gauthereau <charles.gauthereau@soluce-technologies.com> * fix: profile name trim --------- Co-authored-by: killian-larcher <killian.larcher@soluce-technologies.com> Co-authored-by: Charles GTE <charles.gauthereau@soluce-technologies.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: Michael Kutý <6du1ro.n@gmail.com> Co-authored-by: charles-gauthereau <charles.gauthereau@soluce-technologies.com> * chore: release 1.18.3 * chore: Update README.md (#323) * chore: Update README.md added unraid link * chore: Update README.md fix markdown * chore: release 1.18.4 * fix: teams.ts with timeout --------- Co-authored-by: Killian Larcher <98161034+KillianLarcher@users.noreply.github.com> Co-authored-by: killian-larcher <killian.larcher@soluce-technologies.com> Co-authored-by: Charles GTE <charles.gauthereau@soluce-technologies.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: Michael Kutý <6du1ro.n@gmail.com> Co-authored-by: charles-gauthereau <charles.gauthereau@soluce-technologies.com> Co-authored-by: Shawn M <84647313+hyperion02@users.noreply.github.com>
This commit is contained in:
co-authored by
killian-larcher
Charles GTE
github-actions[bot] <github-actions[bot]@users.noreply.github.com>
github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Michael Kutý
Killian Larcher
github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Shawn M
parent
777a8bba3c
commit
130c23dd5b
@@ -45,7 +45,7 @@ export async function remove(page: Page, channelName: string) {
|
||||
*/
|
||||
export async function create(
|
||||
page: Page,
|
||||
provider: "Discord" | "Gotify" | "ntfy.sh" | "Slack" | "Email" | "Telegram" | "Webhook",
|
||||
provider: "Discord" | "Gotify" | "ntfy.sh" | "Slack" | "Email" | "Telegram" | "Webhook" | "Microsoft Teams",
|
||||
channelName: string,
|
||||
fillConfig: (page: Page) => Promise<void>,
|
||||
entrypoint: "auto" | "emptyState" | "button" = "auto",
|
||||
|
||||
@@ -0,0 +1,61 @@
|
||||
import {expect, test} from "@playwright/test";
|
||||
import {
|
||||
cancel, create, get, remove, submit, testFromEdit,
|
||||
} from "../helpers/notification";
|
||||
import {getEnv} from "../helpers/env";
|
||||
import {LOCAL_STORAGE_PATH} from "../helpers/session";
|
||||
|
||||
test.use({storageState: LOCAL_STORAGE_PATH});
|
||||
|
||||
const validChannelName = "Teams E2E Required";
|
||||
const invalidChannelName = "Teams E2E Invalid";
|
||||
|
||||
// test.describe.serial("Valid channel", () => {
|
||||
// test("Create and test a valid Teams channel", async ({page}) => {
|
||||
// await page.goto("/dashboard/notifications/channels");
|
||||
// await expect(page.getByRole("heading", {name: "Notification channels"})).toBeVisible();
|
||||
// await create(page, "Microsoft Teams", validChannelName, async (page) => {
|
||||
// await page.getByLabel(/Teams Webhook URL/).fill(getEnv("E2E_NOTIFICATION_TEAMS_WEBHOOK"));
|
||||
// });
|
||||
// await submit(page);
|
||||
// await expect(page.getByText("Notification channel has been successfully created.")).toBeVisible();
|
||||
// await expect(get(page, validChannelName)).toBeVisible();
|
||||
// await testFromEdit(page, validChannelName);
|
||||
// await expect(page.getByText("Sent to Microsoft Teams")).toBeVisible();
|
||||
// await cancel(page);
|
||||
// });
|
||||
//
|
||||
// test("Edit and test a valid Teams E2E channel", async ({page}) => {
|
||||
// await page.goto("/dashboard/notifications/channels");
|
||||
// await expect(page.getByRole("heading", {name: "Notification channels"})).toBeVisible();
|
||||
// await expect(get(page, validChannelName)).toBeVisible();
|
||||
// await testFromEdit(page, validChannelName);
|
||||
// await expect(page.getByText("Sent to Microsoft Teams")).toBeVisible();
|
||||
// await cancel(page);
|
||||
// });
|
||||
// });
|
||||
|
||||
test.describe.serial("Invalid channel", () => {
|
||||
test("Create and test invalid Teams channel", async ({page}) => {
|
||||
await page.goto("/dashboard/notifications/channels");
|
||||
await expect(page.getByRole("heading", {name: "Notification channels"})).toBeVisible();
|
||||
await create(page, "Microsoft Teams", invalidChannelName, async (page) => {
|
||||
await page.getByLabel(/Teams Webhook URL/).fill("https://WRONG_TEAMS_WEBHOOK");
|
||||
});
|
||||
await submit(page);
|
||||
await expect(page.getByText("Notification channel has been successfully created.")).toBeVisible();
|
||||
await expect(get(page, invalidChannelName)).toBeVisible();
|
||||
await testFromEdit(page, invalidChannelName);
|
||||
await expect(page.getByText("An error occurred while testing the notification channel, check your configuration")).toBeVisible();
|
||||
await cancel(page);
|
||||
});
|
||||
|
||||
test("Delete invalid Teams channel", async ({page}) => {
|
||||
await page.goto("/dashboard/notifications/channels");
|
||||
await expect(page.getByRole("heading", {name: "Notification channels"})).toBeVisible();
|
||||
await expect(get(page, invalidChannelName)).toBeVisible();
|
||||
await remove(page, invalidChannelName);
|
||||
await expect(page.getByText("Notification channel has been successfully removed.")).toBeVisible();
|
||||
await expect(page.getByText(invalidChannelName)).toHaveCount(0);
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user