Skip to content

Convert LocalTests_SettingsModel into UnitTests_SettingsModel #7743

@carlos-zamora

Description

@carlos-zamora

Description of the new feature/enhancement

#7667 introduces the TerminalSettingsModel by ripping out a large chunk of TerminalApp. All of the testing was thrown into LocalTests_SettingsModel. Moving them into a unit tests project like TermApp.UnitTests allows us to run these in CI.

About 20/33 tests are able to be moved into a UnitTests-like project with no modifications.
2/33 can be moved with minor modifications (see below).
The remaining 11/33 require a larger refactor (this issue tracks this).

Proposed technical implementation details (optional)

SettingsModelLocalTests::KeyBindingsTests

  • All of these tests fail because they need to construct a KeyChord. KeyChord is in the TerminalControl namespace.

SettingsModelLocalTests::CommandTests

  • TestResourceKeyName and TestLayerOnAutogeneratedName fail because they need access to the resource loader.

SettingsModelLocalTests::SerializationTests

  • The tests below fail because they need to import defaults.json. Which results in hitting the two cases above.
    • TestReorderWithNullGuids
    • TestReorderingWithoutGuid
    • TestLayeringNameOnlyProfiles
    • TestExplodingNameOnlyProfiles
    • TestDontLayerGuidFromUserDefaults
    • ValidateKeybindingsWarnings
  • TestCommandsAndKeybindings doesn't import defaults.json, but fails again because it hits the two cases above.
  • The two tests that can be fixed fairly easily are ValidateLegacyGlobalsWarning and TestTrailingCommas. They don't really need a dependency on importing defaults.json.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Area-CodeHealthIssues related to code cleanliness, linting, rules, warnings, errors, static analysis, etc.Issue-TaskIt's a feature request, but it doesn't really need a major design.Product-TerminalThe new Windows Terminal.

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions