From 69e5c9f611b767cb82f7fc4576377dc089d05128 Mon Sep 17 00:00:00 2001 From: Joffrey JAFFEUX Date: Tue, 7 May 2024 17:41:49 +0200 Subject: [PATCH] FIX: prevents flakey due to usernames with quotes (#26907) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Faker could generate usernames like `D'angelo` and that doesn’t work out nicely for our tests. Using domain names seems safer. --- app/assets/javascripts/discourse/app/lib/fabricators.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/assets/javascripts/discourse/app/lib/fabricators.js b/app/assets/javascripts/discourse/app/lib/fabricators.js index 557f65ee650..9c10234d366 100644 --- a/app/assets/javascripts/discourse/app/lib/fabricators.js +++ b/app/assets/javascripts/discourse/app/lib/fabricators.js @@ -58,7 +58,7 @@ export default class CoreFabricators { user(args = {}) { return this.store.createRecord("user", { id: args.id || incrementSequence(), - username: args.username || getLoadedFaker().faker.person.firstName(), + username: args.username || getLoadedFaker().faker.internet.domainWord(), name: args.name, avatar_template: "/letter_avatar_proxy/v3/letter/t/41988e/{size}.png", suspended_till: args.suspended_till,