╭─────────────╮ │scroll to top│ ╰─────────────╯ ╭ undo.zig ─────────────────────────────────────────────────────╮ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ╰───────────────────────────────────────────────────────────────╯
╭────╮ ╭ clone ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─╮ │http│ ssh │ │ ╰────╯ ╰ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─╯
213 session.users_dir = users_dir; 214 // tabs switch in-page, so every tab carries the undo data and its failure 215 const files = try ui.Repo.init(&arena, &session, ui.RoutablePage.repoFilesRoute("alice:demo", null, "", "", 0).?); 216 try std.testing.expectEqual(0, files.undo.?.items.len); 217 try std.testing.expectEqualStrings("InvalidUndoRecord", files.undo.?.failure.?); 218 const undo = try ui.Repo.init(&arena, &session, ui.RoutablePage.repoUndoRoute("alice:demo", null).?); 219 try std.testing.expectEqualStrings("InvalidUndoRecord", undo.undo.?.failure.?); 220 221 var root = ui.Widget{ .repo_undo = try Undo.View.init(allocator, &undo.undo.?, &session) }; 222 defer root.deinit(allocator); 223 try root.build(allocator, constraint, root.getFocus()); 224 const html = try @import("../web.zig").generateHtml(allocator, &root, &session); 225 defer allocator.free(html); 226 try std.testing.expect(std.mem.indexOf(u8, html, "InvalidUndoRecord") != null); 227 } 228