context.skip("Permissions API", () => {
	before(() => {
		cy.visit("/login");
		cy.remove_role("jingrow@example.com", "System Manager");
		cy.visit("/app");
	});

	it("Checks permissions via `has_perm` for Kanban Board PageType", () => {
		cy.visit("/app/kanban-board/view/list");
		cy.window()
			.its("jingrow")
			.then((jingrow) => {
				jingrow.model.with_pagetype("Kanban Board", function () {
					// needed to make sure pg meta is loaded
					expect(jingrow.perm.has_perm("Kanban Board", 0, "read")).to.equal(true);
					expect(jingrow.perm.has_perm("Kanban Board", 0, "write")).to.equal(true);
					expect(jingrow.perm.has_perm("Kanban Board", 0, "print")).to.equal(false);
				});
			});
	});

	it("Checks permissions via `get_perm` for Kanban Board PageType", () => {
		cy.visit("/app/kanban-board/view/list");
		cy.window()
			.its("jingrow")
			.then((jingrow) => {
				jingrow.model.with_pagetype("Kanban Board", function () {
					// needed to make sure pg meta is loaded
					const perms = jingrow.perm.get_perm("Kanban Board");
					expect(perms.read).to.equal(true);
					expect(perms.write).to.equal(true);
					expect(perms.rights_without_if_owner).to.include("read");
				});
			});
	});

	after(() => {
		cy.add_role("jingrow@example.com", "System Manager");
		cy.call("logout");
	});
});
