Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FIX: Broken group messages inboxes when group name is mixed case #22183

Merged

Conversation

tgxworld
Copy link
Contributor

This is a follow up to 1cbc65b where
visiting a group with a mixed case name would result in an error.

@tgxworld tgxworld force-pushed the fix_error_when_viewing_group_inbox branch 2 times, most recently from 36dd0e1 to 7165776 Compare June 19, 2023 06:23
@discoursebot
Copy link

This pull request has been mentioned on Discourse Meta. There might be relevant details there:

https://meta.discourse.org/t/message-category-selector-for-group-messages-leads-to-error-something-went-wrong/268607/7

This is a follow up to 1cbc65b where
visiting a group with a mixed case name would result in an error.
@tgxworld tgxworld force-pushed the fix_error_when_viewing_group_inbox branch from 7165776 to 3739c10 Compare June 19, 2023 09:26
Comment on lines -975 to -1022
acceptance(
"User Private Messages - user with uppercase username",
function (needs) {
needs.user({
groups: [{ id: 14, name: "awesome_group", has_messages: true }],
});

needs.pretender((server, helper) => {
const response = cloneJSON(userFixtures["/u/charlie.json"]);
response.user.username = "chArLIe";
server.get("/u/charlie.json", () => helper.response(response));

server.get(
"/topics/private-messages-group/:username/:group_name.json",
() => {
return helper.response({
topic_list: {
topics: [
{ id: 1, posters: [] },
{ id: 2, posters: [] },
],
},
});
}
);
});

test("viewing inbox", async function (assert) {
await visit("/u/charlie/messages");

assert.strictEqual(
query(".user-nav-messages-dropdown .selected-name").textContent.trim(),
"Inbox",
"menu defaults to Inbox"
);
});

test("viewing group inbox", async function (assert) {
await visit("/u/charlie/messages/group/awesome_group");

assert.strictEqual(
query(".user-nav-messages-dropdown .selected-name").textContent.trim(),
"awesome_group",
"dropdown menu displays the right group name"
);
});
}
);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changing to a system test because it is a nightmare to get the fixtures right here.

@tgxworld tgxworld merged commit 57c96ed into discourse:main Jun 19, 2023
13 checks passed
@tgxworld tgxworld deleted the fix_error_when_viewing_group_inbox branch June 19, 2023 09:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants