Skip to content

Commit

Permalink
Move tests from plugin to component
Browse files Browse the repository at this point in the history
  • Loading branch information
brrusselburg committed Nov 29, 2024
1 parent dfa0860 commit af0fd4f
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 27 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ export default class UpcomingEventsList extends Component {
const categorySlug = this.router.currentRoute.attributes?.category?.slug;
const titleSetting = this.siteSettings?.map_events_title;

if (titleSetting == "") {
if (titleSetting === "") {
return I18n.t("discourse_post_event.upcoming_events_list.title");
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -163,32 +163,6 @@ module("Integration | Component | upcoming-events-list", function (hooks) {
);
});

test("with events, overridden titles", async function (assert) {
// this.siteSettings.map_events_title =
// '[{"category_slug": "announcements", "custom_title": "Upcoming Announcements"}]';
// await render(<template><UpcomingEventsList /></template>);
// this.appEvents.trigger("page:changed", { url: "/c/1" });
// debugger;
// // this.args.params.categorySlug = "announcements";
// assert.strictEqual(
// query(".upcoming-events-list__heading").innerText,
// "Upcoming Announcements",
// "it sets 'Upcoming Announcements' as the title in 'c/announcements'"
// );
// this.args.params.categorySlug = "events";
// assert.equal(
// component.title(),
// "Upcoming Cool Events",
// "it sets 'Upcoming Cool Events' as the title in 'c/events'"
// );
// this.args.params.categorySlug = "unknown";
// assert.equal(
// component.title(),
// "Upcoming Events",
// "it returns the default value for title when otherwise not specified"
// );
});

test("with events, view-all navigation", async function (assert) {
pretender.get("/discourse-post-event/events", twoEventsResponseHandler);

Expand Down

0 comments on commit af0fd4f

Please sign in to comment.