Keep the browser draft on screen after Save your progress, including when the save link is dead.
This commit is contained in:
1 parent
d576ed81d9
commit
d31045b0e5
6 files changed
+141
-12
No files matched your search
@@ -15,6 +15,7 @@ import {
|
||||
CREATE_FLOW_ANONYMOUS_KEY,
|
||||
CREATE_FLOW_TRANSFER_PENDING_KEY,
|
||||
clearAnonymousCreateFlowStorage,
|
||||
clearTransferPendingFlag,
|
||||
} from "../../app/(app)/create/utils/anonymousDraftStorage";
|
||||
|
||||
describe("clearAnonymousCreateFlowStorage", () => {
|
||||
@@ -41,3 +42,19 @@ describe("clearAnonymousCreateFlowStorage", () => {
|
||||
expect(forgetFlushedCommunityAvatarUrl).not.toHaveBeenCalled();
|
||||
});
|
||||
});
|
||||
|
||||
describe("clearTransferPendingFlag", () => {
|
||||
beforeEach(() => {
|
||||
localStorage.clear();
|
||||
localStorage.setItem(CREATE_FLOW_ANONYMOUS_KEY, "{\"title\":\"Garden\"}");
|
||||
localStorage.setItem(CREATE_FLOW_TRANSFER_PENDING_KEY, "1");
|
||||
});
|
||||
|
||||
it("removes the flag and leaves the stored draft", () => {
|
||||
clearTransferPendingFlag();
|
||||
expect(localStorage.getItem(CREATE_FLOW_TRANSFER_PENDING_KEY)).toBeNull();
|
||||
expect(localStorage.getItem(CREATE_FLOW_ANONYMOUS_KEY)).toBe(
|
||||
"{\"title\":\"Garden\"}",
|
||||
);
|
||||
});
|
||||
});
|
||||
Reference in new issue
Block a user