Keep draft notes off the How it works guide, link the conflict article, and print only the rule card.
This commit is contained in:
1 parent
453139c783
commit
95f7291c45
7 files changed
+136
-61
No files matched your search
@@ -19,7 +19,7 @@ describe("HowItWorksShareRow", () => {
|
||||
});
|
||||
});
|
||||
|
||||
it("copies wiki markdown and prints the page", async () => {
|
||||
it("copies wiki markdown and prints only the rule card", async () => {
|
||||
const print = vi.spyOn(window, "print").mockImplementation(() => {});
|
||||
|
||||
render(
|
||||
@@ -48,6 +48,11 @@ describe("HowItWorksShareRow", () => {
|
||||
|
||||
fireEvent.click(screen.getByRole("button", { name: "Print the card" }));
|
||||
expect(print).toHaveBeenCalled();
|
||||
const printStyle = document.getElementById("how-it-works-card-print");
|
||||
expect(printStyle?.textContent).toContain("#how-it-works-rule-card");
|
||||
expect(printStyle?.textContent).toContain("visibility: hidden");
|
||||
window.dispatchEvent(new Event("afterprint"));
|
||||
expect(document.getElementById("how-it-works-card-print")).toBeNull();
|
||||
print.mockRestore();
|
||||
});
|
||||
});
|
||||
Reference in new issue
Block a user