FIX: no need to hide "Later This Week" when showing "Later Today" (#16365)

This commit is contained in:
Andrei Prigorshnev 2022-04-05 12:49:05 +00:00 committed by GitHub
parent 7edc941843
commit 8a9c644021
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 9 additions and 3 deletions

View File

@ -33,7 +33,7 @@ const TIMEFRAMES = [
buildTimeframe({
id: "later_this_week",
format: "ddd, h a",
enabled: (opts) => !opts.canScheduleToday && opts.day > 0 && opts.day < 4,
enabled: (opts) => opts.day > 0 && opts.day < 4,
when: (time, timeOfDay) => time.add(2, "day").hour(timeOfDay).minute(0),
}),
buildTimeframe({

View File

@ -34,6 +34,7 @@ acceptance("Admin - Silence User", function (needs) {
const expected = [
I18n.t("topic.auto_update_input.later_today"),
I18n.t("topic.auto_update_input.tomorrow"),
I18n.t("topic.auto_update_input.later_this_week"),
I18n.t("topic.auto_update_input.next_week"),
I18n.t("topic.auto_update_input.two_weeks"),
I18n.t("topic.auto_update_input.next_month"),

View File

@ -133,6 +133,7 @@ acceptance("Admin - Suspend User - timeframe choosing", function (needs) {
const expected = [
I18n.t("topic.auto_update_input.later_today"),
I18n.t("topic.auto_update_input.tomorrow"),
I18n.t("topic.auto_update_input.later_this_week"),
I18n.t("topic.auto_update_input.next_week"),
I18n.t("topic.auto_update_input.two_weeks"),
I18n.t("topic.auto_update_input.next_month"),

View File

@ -213,6 +213,7 @@ acceptance(
const expected = [
I18n.t("topic.auto_update_input.later_today"),
I18n.t("topic.auto_update_input.tomorrow"),
I18n.t("topic.auto_update_input.later_this_week"),
I18n.t("topic.auto_update_input.next_week"),
I18n.t("topic.auto_update_input.two_weeks"),
I18n.t("topic.auto_update_input.next_month"),

View File

@ -53,6 +53,7 @@ acceptance("Topic - Set Slow Mode", function (needs) {
const expected = [
I18n.t("topic.auto_update_input.later_today"),
I18n.t("topic.auto_update_input.tomorrow"),
I18n.t("topic.auto_update_input.later_this_week"),
I18n.t("topic.auto_update_input.next_week"),
I18n.t("topic.auto_update_input.two_weeks"),
I18n.t("topic.auto_update_input.next_month"),

View File

@ -138,6 +138,7 @@ acceptance("User Notifications - Users - Ignore User", function (needs) {
const expected = [
I18n.t("topic.auto_update_input.later_today"),
I18n.t("topic.auto_update_input.tomorrow"),
I18n.t("topic.auto_update_input.later_this_week"),
I18n.t("topic.auto_update_input.this_weekend"),
I18n.t("topic.auto_update_input.next_week"),
I18n.t("topic.auto_update_input.two_weeks"),

View File

@ -32,6 +32,7 @@ module("Unit | Lib | timeframes-builder", function (hooks) {
const expected = [
"later_today",
"tomorrow",
"later_this_week",
"next_week",
"two_weeks",
"next_month",
@ -112,9 +113,9 @@ module("Unit | Lib | timeframes-builder", function (hooks) {
assert.ok(timeframes.includes("later_this_week"));
});
test("doesn't output 'Later This Week' on Tuesdays", function (assert) {
test("doesn't output 'Later This Week' on Thursdays", function (assert) {
const timezone = moment.tz.guess();
this.clock = fakeTime("2100-04-22 18:00:00", timezone, true); // Tuesday evening
this.clock = fakeTime("2100-04-22 18:00:00", timezone, true); // Thursday evening
const timeframes = buildTimeframes(buildOptions(moment())).mapBy("id");
assert.notOk(timeframes.includes("later_this_week"));