From 66f01953eeb67027743f26eee428b9146ed74638 Mon Sep 17 00:00:00 2001 From: Jeff Daley Date: Tue, 12 Mar 2024 15:09:02 -0400 Subject: [PATCH] Allow drafts to be transferred --- web/app/components/document/sidebar.hbs | 3 ++- .../acceptance/authenticated/document-test.ts | 21 ++----------------- 2 files changed, 4 insertions(+), 20 deletions(-) diff --git a/web/app/components/document/sidebar.hbs b/web/app/components/document/sidebar.hbs index 261e7cb19..549102274 100644 --- a/web/app/components/document/sidebar.hbs +++ b/web/app/components/document/sidebar.hbs @@ -408,12 +408,13 @@ {{/each-in}} {{! Transfer ownership }} - {{#if (and this.isOwner (not this.isDraft))}} + {{#if this.isOwner}}
diff --git a/web/tests/acceptance/authenticated/document-test.ts b/web/tests/acceptance/authenticated/document-test.ts index e30ed51a9..341a8ae5a 100644 --- a/web/tests/acceptance/authenticated/document-test.ts +++ b/web/tests/acceptance/authenticated/document-test.ts @@ -1596,7 +1596,7 @@ module("Acceptance | authenticated/document", function (hooks) { assert.dom(DISABLED_FOOTER_H5).hasText("Document is locked"); }); - test("owners can transfer ownership of their published docs", async function (this: AuthenticatedDocumentRouteTestContext, assert) { + test("owners can transfer ownership of their docs", async function (this: AuthenticatedDocumentRouteTestContext, assert) { this.server.create("document", { id: 1, objectID: 1, @@ -1612,23 +1612,6 @@ module("Acceptance | authenticated/document", function (hooks) { await visit("/document/1"); - assert - .dom(TRANSFER_OWNERSHIP_BUTTON) - .doesNotExist("drafts cannot be transferred"); - - this.server.create("document", { - id: 2, - objectID: 2, - isDraft: false, - status: "In-review", - }); - - await visit("/document/2"); - - assert - .dom(TRANSFER_OWNERSHIP_BUTTON) - .exists('the "transfer ownership" button is shown for published docs'); - await click(TRANSFER_OWNERSHIP_BUTTON); assert.dom(TRANSFER_OWNERSHIP_MODAL).exists(); @@ -1695,7 +1678,7 @@ module("Acceptance | authenticated/document", function (hooks) { assert.dom(OWNERSHIP_TRANSFERRED_MODAL).doesNotExist(); - const doc = this.server.schema.document.find(2); + const doc = this.server.schema.document.find(1); const docOwner = doc.attrs.owners[0]; assert.equal(