prettier-playwright-msteams-report
Version:
A modified version of the Playwright MS Teams Messager
46 lines (45 loc) • 1.47 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
const _1 = require(".");
describe("getNotificationTitle", () => {
it("should return 'Tests passed' when the outcome is 'passed'", () => {
const statuses = {
passed: 1,
failed: 0,
flaky: 0,
skipped: 0,
};
const title = (0, _1.getNotificationTitle)(statuses);
expect(title).toBe("Tests passed");
});
it("should return 'Tests passed with flaky tests' when the outcome is 'flaky'", () => {
const statuses = {
passed: 1,
failed: 0,
flaky: 1,
skipped: 0,
};
const title = (0, _1.getNotificationTitle)(statuses);
expect(title).toBe("Tests passed with flaky tests");
});
it("should return 'Tests failed' when the outcome is neither 'passed' nor 'flaky'", () => {
const statuses = {
passed: 1,
failed: 1,
flaky: 1,
skipped: 0,
};
const title = (0, _1.getNotificationTitle)(statuses);
expect(title).toBe("Tests failed");
});
it("should return 'Tests passed' when only skipped", () => {
const statuses = {
passed: 0,
failed: 0,
flaky: 0,
skipped: 1,
};
const title = (0, _1.getNotificationTitle)(statuses);
expect(title).toBe("Tests passed");
});
});