diff --git a/app/assets/javascripts/discourse/app/components/bookmark.js b/app/assets/javascripts/discourse/app/components/bookmark.js index 51cce43e7ce..7132f03a5cc 100644 --- a/app/assets/javascripts/discourse/app/components/bookmark.js +++ b/app/assets/javascripts/discourse/app/components/bookmark.js @@ -61,7 +61,7 @@ export default Component.extend({ showOptions: false, _itsatrap: new ItsATrap(), autoDeletePreference: - this.model.autoDeletePreference || + this.model.autoDeletePreference ?? AUTO_DELETE_PREFERENCES.CLEAR_REMINDER, }); diff --git a/app/assets/javascripts/discourse/tests/integration/components/bookmark-test.js b/app/assets/javascripts/discourse/tests/integration/components/bookmark-test.js index f5243652b93..2d254feba00 100644 --- a/app/assets/javascripts/discourse/tests/integration/components/bookmark-test.js +++ b/app/assets/javascripts/discourse/tests/integration/components/bookmark-test.js @@ -3,6 +3,7 @@ import { setupRenderingTest } from "discourse/tests/helpers/component-test"; import { render } from "@ember/test-helpers"; import { query } from "discourse/tests/helpers/qunit-helpers"; import { hbs } from "ember-cli-htmlbars"; +import I18n from "I18n"; module("Integration | Component | bookmark", function (hooks) { setupRenderingTest(hooks); @@ -21,7 +22,7 @@ module("Integration | Component | bookmark", function (hooks) { test("prefills the custom reminder type date and time", async function (assert) { let name = "test"; let reminderAt = "2020-05-15T09:45:00"; - this.model = { id: 1, name, reminderAt }; + this.model = { id: 1, autoDeletePreference: 0, name, reminderAt }; await render(hbs` .name").innerHTML.trim(), + I18n.t("bookmarks.auto_delete_preference.never") + ); }); });