Skip to content

OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub

Fix settings spec by checking for in_app settings

Oliver Günther1de617d3eca7
diff --git a/frontend/src/app/features/user-preferences/reminder-settings/page/reminder-settings-page.component.html b/frontend/src/app/features/user-preferences/reminder-settings/page/reminder-settings-page.component.html
index 57b2af17617..e8c0c1f4be9 100644
--- a/frontend/src/app/features/user-preferences/reminder-settings/page/reminder-settings-page.component.html
+++ b/frontend/src/app/features/user-preferences/reminder-settings/page/reminder-settings-page.component.html
@@ -1,33 +1,34 @@
<div class="title-container">
- <h2 [textContent]="text.title"></h2>
+ <h2 [textContent]="text.title"></h2>
</div>
<form
- [formGroup]="form"
- (ngSubmit)="saveChanges()"
- class="op-form"
+ *ngIf="formInitialized"
+ [formGroup]="form"
+ (ngSubmit)="saveChanges()"
+ class="op-form"
>
- <section class="form--section">
- <h5 [textContent]="text.immediate.title"></h5>
- <op-immediate-reminder-settings></op-immediate-reminder-settings>
- </section>
- <section class="form--section">
- <h5 [textContent]="text.daily.title"></h5>
- <p [textContent]="text.daily.explanation"></p>
+ <section class="form--section">
+ <h5 [textContent]="text.immediate.title"></h5>
+ <op-immediate-reminder-settings></op-immediate-reminder-settings>
+ </section>
+ <section class="form--section">
+ <h5 [textContent]="text.daily.title"></h5>
+ <p [textContent]="text.daily.explanation"></p>
- <op-reminder-settings-daily-time>
- </op-reminder-settings-daily-time>
- </section>
- <section class="form--section">
- <h5 [textContent]="text.alerts.title"></h5>
- <p [textContent]="text.alerts.explanation"></p>
- <op-email-alerts-settings></op-email-alerts-settings>
- </section>
- <div class="generic-table--action-buttons">
- <button
- class="button -highlight"
- [textContent]="text.save"
- type="submit"
- ></button>
- </div>
+ <op-reminder-settings-daily-time>
+ </op-reminder-settings-daily-time>
+ </section>
+ <section class="form--section">
+ <h5 [textContent]="text.alerts.title"></h5>
+ <p [textContent]="text.alerts.explanation"></p>
+ <op-email-alerts-settings></op-email-alerts-settings>
+ </section>
+ <div class="generic-table--action-buttons">
+ <button
+ class="button -highlight"
+ [textContent]="text.save"
+ type="submit"
+ ></button>
+ </div>
</form>
diff --git a/frontend/src/app/features/user-preferences/reminder-settings/page/reminder-settings-page.component.ts b/frontend/src/app/features/user-preferences/reminder-settings/page/reminder-settings-page.component.ts
index 003bf520ab3..8a6e57097bc 100644
--- a/frontend/src/app/features/user-preferences/reminder-settings/page/reminder-settings-page.component.ts
+++ b/frontend/src/app/features/user-preferences/reminder-settings/page/reminder-settings-page.component.ts
@@ -82,6 +82,8 @@ export class ReminderSettingsPageComponent extends UntilDestroyedMixin implement
},
};
+ formInitialized = false;
+
constructor(
private I18n:I18nService,
private storeService:UserPreferencesService,
@@ -126,6 +128,7 @@ export class ReminderSettingsPageComponent extends UntilDestroyedMixin implement
this.form.get(`emailAlerts.${alert}`)?.setValue(globalSetting[alert]);
});
+ this.formInitialized = true;
this.cdRef.detectChanges();
});
}
diff --git a/spec/support/pages/notifications/settings.rb b/spec/support/pages/notifications/settings.rb
index b7443337fa1..89a9be4f877 100644
--- a/spec/support/pages/notifications/settings.rb
+++ b/spec/support/pages/notifications/settings.rb
@@ -44,7 +44,7 @@ module Pages
end
def expect_represented
- user.notification_settings.each do |setting|
+ user.notification_settings.where(channel: :in_app).each do |setting|
expect_global_represented(setting)
# expect_project_represented(setting)
end
diff --git a/spec/support/pages/reminders/settings.rb b/spec/support/pages/reminders/settings.rb
index d47042a4f7a..81711430db2 100644
--- a/spec/support/pages/reminders/settings.rb
+++ b/spec/support/pages/reminders/settings.rb
@@ -70,9 +70,9 @@ module Pages
def expect_immediate_reminder(name, enabled)
if enabled
- expect(page).to have_checked_field("op-reminder-settings-immediate-#{name}")
+ expect(page).to have_selector("input[data-qa-immediate-reminder='#{name}']:checked")
else
- expect(page).to have_no_checked_field("op-reminder-settings-immediate-#{name}")
+ expect(page).to have_selector("input[data-qa-immediate-reminder='#{name}']:not(:checked)")
end
end