Class CharacterCreationUiTests
- Namespace
- GrindFest
- Assembly
- GrindFest.dll
The engine half of the character-creation screen: opening the panel spawns a preview hero, closing it takes that hero away again, and nothing is left behind.
This earned a test on 2026-09-17 because the flow failed silently inside the panel: the TSX spawned the preview with Object.Instantiate(Object, Vector3, Quaternion), which OneJS v3 cannot bind at all - the dispatcher answers "Method not found: UnityEngine.Object.Instantiate" because that name also carries generic overloads (measured: the 1-arg and the Transform overload do bind). The panel looked exactly the same whether the spawn worked or threw, and "create a hero" is not something a player can work around. The spawn now lives in UICharacterCreation.ShowPreviewForClass, so a bridge call that throws fails right here instead of in someone's playtest.
Setup uses backdoors (closing whatever was open, asking C# to drop a preview); the behaviour under test - show and hide the preview - is driven through the game's own entry points, the same calls the character-selection screen and the panel's Back button make.
public class CharacterCreationUiTests : DevTest
- Inheritance
-
objectCharacterCreationUiTests
- Inherited Members
Properties
- NeedsFreshUi
True for a test that reads the OneJS UI, which makes the runner reload the whole UI before it. That reload is the only reset that reaches the state a panel keeps while it stays mounted but hidden - the Character screen's selected tab, for instance, which made two CharacterScreenUiTests fail with "Timeout waiting for 'Strength' visible" after the tab had been picked by hand before the run.
Opt-in because it is not free: measured 2026-09-16, reloading before every test left 888 s of a 1194 s suite outside the test bodies (against 119 s in the 358 s run without it), roughly 8,5 s per test. Only the tests that actually read the UI pay that.
Methods
- CharacterCreation_OpenPanel_SpawnsPreviewHeroAndClearsItOnClose()
Player path: open the creation panel, then close it again. A preview hero has to appear with the panel and disappear with it.
- CharacterCreation_TypeNameAndCreate_AddsTheHeroToTheParty()
The whole creation flow the way a player walks it: pick the class, type a name, press Create.
This is the test that was missing on 2026-09-17, when typing a name left the panel saying "Fill in hero name!" and the hero could not be created at all. The cause was invisible to every test that existed: onejs-react's TextField reports changes through
onChangewith the text ine.value, and the panel listened ononValueChangedreadinge.newValue- a prop the component does not have, so the handler was dropped. A field that nothing listens to looks exactly like a working field: the text appears, the value never leaves it. Only typing and then acting on the result can tell the difference, which is what this test does.