Skip to content

Conversation

@Marc-Spector
Copy link
Collaborator

@Marc-Spector Marc-Spector commented Oct 20, 2025

Closes #3308

Summary by CodeRabbit

  • New Features

    • Input validation now enforces ASCII-only characters for title and password fields
    • Warning indicators display when invalid characters are detected
    • Play button is disabled when required fields contain invalid input
  • UI/UX Improvements

    • Enhanced layout and visual feedback in game setup interface

@Marc-Spector Marc-Spector marked this pull request as ready for review October 22, 2025 18:40
@Marc-Spector Marc-Spector force-pushed the feature/validate-coop-game-title branch from 89ba353 to 4b12957 Compare October 26, 2025 14:06
@coderabbitai
Copy link

coderabbitai bot commented Oct 26, 2025

Walkthrough

This pull request adds ASCII-character validation to Coop game titles and passwords to match the existing validation in regular game creation. The Validator utility is refactored to replace custom null checks with Java's standard Objects.requireNonNull and adds an isAscii method for character validation.

Changes

Cohort / File(s) Summary
Validator refactoring
src/main/java/com/faforever/client/util/Validator.java
Removed notNull(Object, String) method; added isAscii(String) method using StandardCharsets.US_ASCII encoding validation.
Null-check migration
src/main/java/com/faforever/client/map/MapUploadTask.java, src/main/java/com/faforever/client/mod/ModUploadTask.java
Replaced Validator.notNull() calls with Objects.requireNonNull() for mapPath and modPath parameters.
Coop validation logic
src/main/java/com/faforever/client/coop/CoopController.java
Added INVALID_PSEUDO_CLASS constant and warning label fields; implemented composite validation for title and password combining emptiness and ASCII checks; added helper methods for invalid-state management and listeners for ASCII validation.
Game creation validation
src/main/java/com/faforever/client/game/CreateGameController.java
Refactored title field listener to use reactive subscription and replaced manual ASCII encoding check with Validator.isAscii() call.
Coop UI layout
src/main/resources/theme/play/coop/coop.fxml
Updated JavaFX namespace to version 25; wrapped title and password fields with VBox containers and added warning labels; adjusted map preview and description area row spanning; added invalid-text-field style classes.
Create game UI styling
src/main/resources/theme/play/create_game.fxml
Added invalid-text-field CSS class to title text field.
CSS styling
src/main/resources/theme/style.css
Renamed selector from .game-title-input:invalid to .invalid-text-field:invalid.
Coop validation tests
src/test/java/com/faforever/client/coop/CoopControllerTest.java
Added seven new test methods covering default state, ASCII validation, warning label visibility, and pseudo-class state updates.

Sequence Diagram(s)

sequenceDiagram
    actor User
    participant TitleField as Title TextField
    participant Validator
    participant WarningLabel
    participant PlayButton

    User->>TitleField: Enter non-ASCII text (e.g., "Hëllö")
    TitleField->>Validator: isAscii(text)
    Validator-->>TitleField: false
    TitleField->>WarningLabel: setVisible(true)
    WarningLabel-->>User: Display warning
    TitleField->>PlayButton: setDisable(true)
    PlayButton-->>User: Button disabled

    User->>TitleField: Clear and enter ASCII text (e.g., "Hello")
    TitleField->>Validator: isAscii(text)
    Validator-->>TitleField: true
    TitleField->>WarningLabel: setVisible(false)
    WarningLabel-->>User: Warning hidden
    TitleField->>PlayButton: setDisable(false)
    PlayButton-->>User: Button enabled
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

  • Areas requiring extra attention:
    • CoopController validation logic: Verify that the composite bind correctly handles both emptiness and ASCII validation edge cases for title and password fields
    • FXML layout restructuring (coop.fxml): Row spanning and GridPane alignment changes may affect layout rendering; visually verify the UI layout matches design intent
    • Test methods in CoopControllerTest: Verify test naming conventions and coverage completeness (test names like test0, test1, etc. lack descriptive clarity)
    • CSS selector rename: Confirm that all references to .game-title-input:invalid have been migrated to .invalid-text-field:invalid

Suggested reviewers

  • Sheikah45

Poem

🐰 A rabbit hops through text so fine,
Now ASCII checks align!
Warning labels glow so red,
When non-ASCII is spread,
Validation's dance—both clean and neat! ✨

Pre-merge checks and finishing touches

❌ Failed checks (2 warnings)
Check name Status Explanation Resolution
Out of Scope Changes Check ⚠️ Warning Several changes appear to be out of scope for the stated objective of adding validation for coop game title and password fields. Specifically, MapUploadTask.java and ModUploadTask.java replace Validator.notNull() calls with Objects.requireNonNull(), which is a refactoring of null checking logic unrelated to implementing coop game validation. As a consequence, the Validator.notNull() method is removed from Validator.java, even though the primary focus should be on adding the isAscii() validation feature for coop games. While CreateGameController.java updates to use Validator.isAscii() could be justified as ensuring consistency, the upload task changes appear to be a separate refactoring bundled into this PR. Consider separating the null-check refactoring (MapUploadTask.java, ModUploadTask.java, and the related Validator.notNull removal) into a separate pull request to keep the scope focused on the coop game validation feature. Alternatively, provide clarification on why the upload task refactoring and removal of Validator.notNull() is necessary as part of implementing this validation change.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The title "Add validation of title and password text fields for coop games" is specific, clear, and directly aligned with the primary objective of the pull request. It accurately summarizes the main change which is implementing validation for coop game titles and passwords with ASCII and non-empty checks. The title appropriately highlights what a teammate would understand as the key purpose of this changeset.
Linked Issues Check ✅ Passed The pull request successfully addresses all coding requirements from issue #3308. The implementation adds ASCII validation for both title and password fields through the new Validator.isAscii() method, maintains the non-empty check validation, and integrates validation into the UI with warning labels and a disabled play button when validation fails. The CoopController has been updated to prevent hosting when fields are invalid, tests have been added to verify the validation behavior, and the FXML layout includes visual feedback through warning labels for user guidance.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feature/validate-coop-game-title

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 5

🧹 Nitpick comments (10)
src/main/java/com/faforever/client/mod/ModUploadTask.java (1)

111-113: Swap logging argument order for clarity

Message says “requestId=[{}], zip filePath=[{}]” but arguments are (filePath, requestId). Swap them to avoid confusing logs.

-    log.debug("Uploading mod to S3: requestId=[{}], zip filePath=[{}]", filePath, requestId);
+    log.debug("Uploading mod to S3: requestId=[{}], zip filePath=[{}]", requestId, filePath);
src/main/java/com/faforever/client/game/CreateGameController.java (3)

197-205: Gate subscription with when(showing) and drop duplicate listener

Use when(showing) to avoid lifecycle leaks and update the create button from the same subscription; then remove the extra addListener on title.

-    titleTextField.textProperty().subscribe(text -> {
-      lastGamePrefs.setLastGameTitle(text);
-      validateTitle(text);
-    });
+    titleTextField.textProperty().when(showing).subscribe(text -> {
+      lastGamePrefs.setLastGameTitle(text);
+      validateTitle(text);
+      setCreateGameButtonState();
+    });
@@
-    JavaFxUtil.addListener(titleTextField.textProperty(), createButtonStateListener);
+    // Redundant after subscription calls setCreateGameButtonState()

228-235: Use Validator.isAscii for consistency (avoid ad-hoc CharsetEncoder)

Unify ASCII checks with Validator.isAscii used elsewhere.

-        CharsetEncoder charsetEncoder = StandardCharsets.US_ASCII.newEncoder();
         if (StringUtils.isBlank(title)) {
           yield "game.create.titleMissing";
-        } else if (!charsetEncoder.canEncode(title)) {
+        } else if (!Validator.isAscii(title)) {
           yield "game.create.titleNotAscii";
-        } else if (password != null && !charsetEncoder.canEncode(password)) {
+        } else if (password != null && !Validator.isAscii(password)) {
           yield "game.create.passwordNotAscii";
         } else if (featuredModListView.getSelectionModel().getSelectedItem() == null) {
           yield "game.create.featuredModMissing";

195-201: Apply initial validation once on initialize

After setting initial title/password, call validateTitle(...) once so the invalid border reflects the starting state.

     setLastGameTitle();
     initPassword();
+    validateTitle(titleTextField.getText());

Also applies to: 269-270

src/main/java/com/faforever/client/util/Validator.java (1)

18-20: Make isAscii null-safe

Guard against null to avoid accidental NPEs from UI bindings.

-  public static boolean isAscii(String content) {
-    return StandardCharsets.US_ASCII.newEncoder().canEncode(content);
-  }
+  public static boolean isAscii(String content) {
+    return content != null && StandardCharsets.US_ASCII.newEncoder().canEncode(content);
+  }
src/main/java/com/faforever/client/coop/CoopController.java (1)

238-243: Fix method name typo: “Ascii” not “Acsii”

Rename helper and update both call sites.

-  private void addListenerToUpdateInvalidSelectorStateIfTextIsNotAcsii(TextField field) {
+  private void addListenerToUpdateInvalidSelectorStateIfTextIsNotAscii(TextField field) {
@@
-    addListenerToUpdateInvalidSelectorStateIfTextIsNotAcsii(titleTextField);
-    addListenerToUpdateInvalidSelectorStateIfTextIsNotAcsii(passwordTextField);
+    addListenerToUpdateInvalidSelectorStateIfTextIsNotAscii(titleTextField);
+    addListenerToUpdateInvalidSelectorStateIfTextIsNotAscii(passwordTextField);

Also applies to: 136-138

src/test/java/com/faforever/client/coop/CoopControllerTest.java (3)

137-143: Clarify positive-case test name

Title must be non-empty and ASCII; adjust DisplayName to reflect both.

-  @DisplayName("Play button is enabled if title is not empty")
+  @DisplayName("Play button is enabled if title is ASCII and not empty")

151-164: Also assert layout management of warning labels

To avoid layout gaps when hidden, bind managed to visible and assert both are false by default and toggle together.

Example assertions to add:

   assertFalse(instance.titleWarningLabel.isVisible());
+  assertFalse(instance.titleWarningLabel.isManaged());
   assertFalse(instance.passwordWarningLabel.isVisible());
+  assertFalse(instance.passwordWarningLabel.isManaged());

If not already done in controller/FXML, bind once during initialization:

titleWarningLabel.managedProperty().bind(titleWarningLabel.visibleProperty());
passwordWarningLabel.managedProperty().bind(passwordWarningLabel.visibleProperty());

119-189: Reduce duplication with parameterized tests

Multiple tests repeat the same pattern (set text → assert disabled/invalid). Consider JUnit 5 @ParameterizedTest with MethodSource to cover ASCII/non-ASCII for both fields succinctly.

src/main/resources/theme/play/coop/coop.fxml (1)

53-71: Avoid hardcoded color and font where possible

Prefer themed CSS classes (e.g., “warning-label” or equivalent) over inline textFill="RED" and Font size for consistency and accessibility. If such a class exists, switch to it; otherwise consider adding one in the CSS.

Also applies to: 65-76

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between da6d6df and 4b12957.

📒 Files selected for processing (9)
  • src/main/java/com/faforever/client/coop/CoopController.java (6 hunks)
  • src/main/java/com/faforever/client/game/CreateGameController.java (3 hunks)
  • src/main/java/com/faforever/client/map/MapUploadTask.java (2 hunks)
  • src/main/java/com/faforever/client/mod/ModUploadTask.java (2 hunks)
  • src/main/java/com/faforever/client/util/Validator.java (2 hunks)
  • src/main/resources/theme/play/coop/coop.fxml (4 hunks)
  • src/main/resources/theme/play/create_game.fxml (1 hunks)
  • src/main/resources/theme/style.css (1 hunks)
  • src/test/java/com/faforever/client/coop/CoopControllerTest.java (3 hunks)
🧰 Additional context used
🧬 Code graph analysis (4)
src/main/java/com/faforever/client/mod/ModUploadTask.java (1)
src/test/java/com/faforever/client/mod/ModUploadTaskTest.java (3)
  • Test (46-49)
  • Test (51-55)
  • RunWith (25-67)
src/main/resources/theme/style.css (1)
src/test/java/com/faforever/client/game/CreateGameControllerTest.java (1)
  • Test (448-455)
src/main/java/com/faforever/client/game/CreateGameController.java (2)
src/main/java/com/faforever/client/util/Validator.java (1)
  • Validator (6-21)
src/test/java/com/faforever/client/game/CreateGameControllerTest.java (4)
  • Test (203-211)
  • Test (214-223)
  • Test (448-455)
  • Test (225-234)
src/main/java/com/faforever/client/coop/CoopController.java (1)
src/main/java/com/faforever/client/util/Validator.java (1)
  • Validator (6-21)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
  • GitHub Check: Codacy Static Code Analysis
  • GitHub Check: checks
  • GitHub Check: checks
🔇 Additional comments (9)
src/main/java/com/faforever/client/map/MapUploadTask.java (1)

22-22: LGTM on null-safety switch

Replacing Validator.notNull with Objects.requireNonNull is consistent and preserves behavior (NPE with message). No further changes needed.

Also applies to: 55-56

src/main/java/com/faforever/client/mod/ModUploadTask.java (1)

28-28: LGTM on null-safety switch

Objects.requireNonNull(modPath, ...) is appropriate and consistent with the codebase changes.

Also applies to: 62-62

src/main/java/com/faforever/client/coop/CoopController.java (1)

134-146: Validation wiring looks solid

Invalid-state bindings and playButton disablement correctly combine emptiness and ASCII checks.

src/main/resources/theme/style.css (1)

641-643: Selector rename verified and correctly implemented

The CSS selector rename is complete and correct:

  • Old .game-title-input:invalid selector successfully removed from CSS
  • New .invalid-text-field:invalid selector present (lines 641-643)
  • Relevant TextFields properly updated: titleTextField in create_game.fxml (line 42) retains both "game-title-input" (for font-size) and "invalid-text-field" classes; password and title fields in coop.fxml (lines 55, 69) have "invalid-text-field" applied
src/test/java/com/faforever/client/coop/CoopControllerTest.java (3)

119-126: Good default-state coverage

Validates initial disabled state and empty fields; this guards regressions in default UI state.


166-176: LGTM: pseudo-class state toggles for title

Live check against PseudoClass set is correct and proves the invalid state toggles.


178-188: LGTM: pseudo-class state toggles for password

Mirrors the title case; assertions look good.

src/main/resources/theme/play/coop/coop.fxml (2)

53-70: CSS and controller wiring for validity state are correctly implemented

Verification confirms the implementation is valid:

  • CSS targets .invalid-text-field:invalid at src/main/resources/theme/style.css:641, combining the style class with the pseudo-class
  • CoopController defines INVALID_PSEUDO_CLASS and toggles it via pseudoClassStateChanged() at line 241
  • TextFields in coop.fxml have the required styleClass="invalid-text-field"

The wiring works as intended.


26-27: No mismatch found — JavaFX 25 is explicitly configured

The app runtime is correctly set to JavaFX 25 in build.gradle (line 236: version = "25"), and Java compatibility is also set to JavaVersion.VERSION_25. The FXML namespace javafx/25 aligns with the configured runtime version. No action required.

Likely an incorrect or invalid review comment.

Comment on lines +26 to +27
<GridPane fx:id="coopRoot" gridLinesVisible="true" hgap="10.0" xmlns="http://javafx.com/javafx/25"
xmlns:fx="http://javafx.com/fxml/1" fx:controller="com.faforever.client.coop.CoopController">
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

Remove debug grid lines

gridLinesVisible="true" should not ship; it leaks debug visuals.

-<GridPane fx:id="coopRoot" gridLinesVisible="true" hgap="10.0" xmlns="http://javafx.com/javafx/25"
+<GridPane fx:id="coopRoot" hgap="10.0" xmlns="http://javafx.com/javafx/25"
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
<GridPane fx:id="coopRoot" gridLinesVisible="true" hgap="10.0" xmlns="http://javafx.com/javafx/25"
xmlns:fx="http://javafx.com/fxml/1" fx:controller="com.faforever.client.coop.CoopController">
<GridPane fx:id="coopRoot" hgap="10.0" xmlns="http://javafx.com/javafx/25"
xmlns:fx="http://javafx.com/fxml/1" fx:controller="com.faforever.client.coop.CoopController">
🤖 Prompt for AI Agents
In src/main/resources/theme/play/coop/coop.fxml around lines 26 to 27, the
GridPane has gridLinesVisible="true" which exposes debug visuals; remove the
gridLinesVisible attribute or set it to "false" so the debug grid won't appear
in production UI, and ensure no other debug-only attributes remain in the FXML.

Comment on lines +51 to +77
<VBox spacing="2.0">
<children>
<TextField fx:id="titleTextField" maxWidth="1.7976931348623157E308"
minWidth="100.0" prefWidth="400.0" promptText="%game.create.title"
styleClass="invalid-text-field"/>
<Label fx:id="titleWarningLabel" text="%game.create.titleNotAscii"
textFill="RED" wrapText="true">
<font>
<Font size="14.0"/>
</font>
</Label>
</children>
</VBox>
<VBox spacing="2.0">
<children>
<PasswordField fx:id="passwordTextField" maxWidth="1.7976931348623157E308"
minWidth="100.0" prefWidth="350.0"
promptText="%game.create.password"
styleClass="invalid-text-field"/>
<Label fx:id="passwordWarningLabel" text="%game.create.passwordNotAscii"
textFill="RED" wrapText="true">
<font>
<Font size="14.0"/>
</font>
</Label>
</children>
</VBox>
Copy link

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion | 🟠 Major

Initialize warning labels as hidden and non-managed

Prevent layout gaps and flicker by defaulting labels to invisible and unmanaged in FXML. Controller can toggle visible only.

-<Label fx:id="titleWarningLabel" text="%game.create.titleNotAscii"
-       textFill="RED" wrapText="true">
+<Label fx:id="titleWarningLabel" text="%game.create.titleNotAscii"
+       textFill="RED" wrapText="true" visible="false" managed="false">
     <font>
         <Font size="14.0"/>
     </font>
 </Label>
...
-<Label fx:id="passwordWarningLabel" text="%game.create.passwordNotAscii"
-       textFill="RED" wrapText="true">
+<Label fx:id="passwordWarningLabel" text="%game.create.passwordNotAscii"
+       textFill="RED" wrapText="true" visible="false" managed="false">
     <font>
         <Font size="14.0"/>
     </font>
 </Label>
🤖 Prompt for AI Agents
In src/main/resources/theme/play/coop/coop.fxml around lines 51 to 77, the
warning Labels for title and password are always visible and managed which can
cause layout gaps and flicker; update each Label to set visible="false" and
managed="false" in the FXML so they are hidden and do not occupy layout space by
default, allowing the controller to set visible/managed to true when showing
warnings.

Comment on lines +56 to +57
<Label fx:id="titleWarningLabel" text="%game.create.titleNotAscii"
textFill="RED" wrapText="true">
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

Ensure i18n keys exist

Confirm that game.create.titleNotAscii and game.create.passwordNotAscii are defined in bundle(s).

Also applies to: 70-71


🏁 Script executed:

#!/bin/bash
rg -n 'game\.create\.(titleNotAscii|passwordNotAscii)=' src/main/resources -g '**/*.properties' -C1

Length of output: 632


I can see the Korean bundle has these keys defined. Let me verify they exist in the primary/default bundle as well.





🏁 Script executed:

#!/bin/bash
# Check if keys exist in the default messages.properties file
rg -n 'game\.create\.(titleNotAscii|passwordNotAscii)=' src/main/resources/i18n/messages.properties -C1

Length of output: 0


🏁 Script executed:

#!/bin/bash
# Get a complete overview of all bundles containing these keys
rg -l 'game\.create\.(titleNotAscii|passwordNotAscii)=' src/main/resources -g '**/*.properties'

Length of output: 46


Add i18n keys to default bundle

The keys game.create.titleNotAscii and game.create.passwordNotAscii are defined only in messages_ko.properties but are missing from the default messages.properties bundle. This will cause the FXML labels to fail resolution for non-Korean locales. Add these keys to src/main/resources/i18n/messages.properties.

Also applies to: 70-71

🤖 Prompt for AI Agents
In src/main/resources/theme/play/coop/coop.fxml around lines 56-57 and 70-71 the
FXML references i18n keys game.create.titleNotAscii and
game.create.passwordNotAscii which exist only in messages_ko.properties; add
these two keys with appropriate default (English) messages to
src/main/resources/i18n/messages.properties so the labels resolve for non-Korean
locales, ensuring the key names exactly match and saving the file encoding as
UTF-8.

Comment on lines +42 to 43
<TextField fx:id="titleTextField" promptText="%game.create.title" styleClass="game-title-input, invalid-text-field"
GridPane.columnSpan="2147483647"/>
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Fix styleClass separator (comma breaks CSS class matching)

Use space-separated classes; the comma makes the first class “game-title-input,” which won’t match CSS.

-<TextField fx:id="titleTextField" promptText="%game.create.title" styleClass="game-title-input, invalid-text-field"
+<TextField fx:id="titleTextField" promptText="%game.create.title" styleClass="game-title-input invalid-text-field"
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
<TextField fx:id="titleTextField" promptText="%game.create.title" styleClass="game-title-input, invalid-text-field"
GridPane.columnSpan="2147483647"/>
<TextField fx:id="titleTextField" promptText="%game.create.title" styleClass="game-title-input invalid-text-field"
GridPane.columnSpan="2147483647"/>
🤖 Prompt for AI Agents
In src/main/resources/theme/play/create_game.fxml around lines 42 to 43, the
styleClass attribute uses a comma-separated list which makes the first class
include a trailing comma and breaks CSS matching; change the attribute to use
space-separated class names (e.g., "game-title-input invalid-text-field") and
remove any trailing commas so both classes are applied correctly.

Comment on lines +127 to +135
@Test
@DisplayName("Play button is disabled if title is not acsii or empty")
public void test0() {
runOnFxThreadAndWait(() -> instance.titleTextField.setText("Это не Acsii заголовок"));
assertTrue(instance.playButton.isDisabled());

runOnFxThreadAndWait(() -> instance.titleTextField.setText(""));
assertTrue(instance.playButton.isDisabled());
}
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Fix “ASCII” typos in test names and data

Use the correct “ASCII” spelling in DisplayName and sample strings to keep tests readable and searchable.

Apply this diff:

-  @DisplayName("Play button is disabled if title is not acsii or empty")
+  @DisplayName("Play button is disabled if title is not ASCII or empty")
-  runOnFxThreadAndWait(() -> instance.titleTextField.setText("Это не Acsii заголовок"));
+  runOnFxThreadAndWait(() -> instance.titleTextField.setText("Это не ASCII заголовок"));
...
-  @DisplayName("Play button is disabled if a password is not acsii")
+  @DisplayName("Play button is disabled if a password is not ASCII")
...
-  @DisplayName("State of `invalid` selector in a field is updated if title is not ascii")
+  @DisplayName("State of `invalid` selector in a field is updated if title is not ASCII")
...
-  @DisplayName("State of `invalid` selector in a field is updated if password is not ascii")
+  @DisplayName("State of `invalid` selector in a field is updated if password is not ASCII")
-  runOnFxThreadAndWait(() -> instance.titleTextField.setText("Это не Acsii заголовок"));
+  runOnFxThreadAndWait(() -> instance.titleTextField.setText("Это не ASCII заголовок"));

Also applies to: 145-149, 167-171, 179-183

🤖 Prompt for AI Agents
In src/test/java/com/faforever/client/coop/CoopControllerTest.java around lines
127 to 135 (and likewise at 145-149, 167-171, 179-183), the word “Acsii” is
misspelled; update the @DisplayName annotations to use the correct “ASCII”
spelling and fix any sample strings containing the same typo (e.g., replace
"Acsii" with "ASCII" and correct sample non-ASCII test data text if it
mistakenly contains "Acsii"); run the tests to ensure names and strings compile
and are searchable with the corrected spelling.

Copy link
Member

@Sheikah45 Sheikah45 left a comment

Choose a reason for hiding this comment

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

Is this good from your point of view?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Coop game titles are not sufficiently validated

3 participants