mirror of
https://github.com/discourse/discourse.git
synced 2025-06-04 23:36:11 +08:00
FIX: Various improvements to bookmark modal UI (#10225)
* Do not autofocus name input on mobile * Improve code for formatted reminder type times to not be computed, so the modal times update correctly * Change wording of "Next Monday" to "Monday" for all days except when today is Monday
This commit is contained in:
@ -230,6 +230,32 @@ test("Editing a bookmark", async assert => {
|
||||
assert.verifySteps(["tomorrow"]);
|
||||
});
|
||||
|
||||
test("Opening bookmark modal on desktop should auto-focus name", async assert => {
|
||||
mockSuccessfulBookmarkPost(assert);
|
||||
|
||||
await visit("/t/internationalization-localization/280");
|
||||
await openBookmarkModal();
|
||||
|
||||
assert.equal($("#bookmark-name").is(":focus"), true);
|
||||
});
|
||||
|
||||
acceptance("Bookmarking - Mobile", {
|
||||
loggedIn: true,
|
||||
mobileView: true,
|
||||
afterEach() {
|
||||
sandbox.restore();
|
||||
}
|
||||
});
|
||||
|
||||
test("Opening bookmark modal on mobile should not auto-focus name", async assert => {
|
||||
mockSuccessfulBookmarkPost(assert);
|
||||
|
||||
await visit("/t/internationalization-localization/280");
|
||||
await openBookmarkModal();
|
||||
|
||||
assert.equal($("#bookmark-name").is(":focus"), false);
|
||||
});
|
||||
|
||||
QUnit.skip(
|
||||
"Editing a bookmark that has a Later Today reminder, and it is before 6pm today",
|
||||
async assert => {
|
||||
|
@ -9,7 +9,10 @@ moduleFor("controller:bookmark", {
|
||||
beforeEach() {
|
||||
logIn();
|
||||
KeyboardShortcutInitializer.initialize(Discourse.__container__);
|
||||
BookmarkController = this.subject({ currentUser: User.current() });
|
||||
BookmarkController = this.subject({
|
||||
currentUser: User.current(),
|
||||
site: { isMobileDevice: false }
|
||||
});
|
||||
BookmarkController.onShow();
|
||||
},
|
||||
|
||||
|
Reference in New Issue
Block a user