Repository: terminal
Issue: Tests we should maybe write one day
Labels: Help Wanted,Product-Meta,Area-CodeHealth,Issue-Scenario

I'm gonna use this thread to track things that I think of that probably should be tested, but didn't get a test during the PR for one reason or another. Usually those reasons are 
* We don't have a good testing framework in place for something like that
* It's a feature / UI test, which is a lot trickier to author a test for
* It wasn't worth blocking the PR over

I'll add more to this list as I think of them. 

## Unit Tests

* [ ] https://github.com/microsoft/terminal/pull/8348#discussion_r533606490: If we change the `DefaultProfile`, then serialize the settings, it should be serialized as the value we set it to. 
* [ ] Tests for `OSC 9 ; 9`, #8330
* [ ] Test the newline stripping/replacing in #8634. Don't really have TermControl tests, so that's something.
* [ ] From "Teach flyouts and palette to prefer user bindings over defaults #8725" - test that looking up a binding for an action returns the last one in the settings file
  - [ ] Similarly, ensure that the layering multiple files, the lookup returns the value from the last file
* [ ] #8875 filter control characters pasted to the `TermControl`
* [ ] #9392 - test that combining `--suppressApplicationTitle` (or in the `NewTerminalArgs`) works as expected
* [ ] Fix selection logic with shift on multi-click #9403 
  - For this we'd need unit tests for a terminal control. What we really need are unit tests for `ControlInteractivity` (which wraps the UI-like logic around the `ControlCore`). We could do just unit tests for ControlInteractivity, since that would be UI-independent. Oh but if it's in the same lib as TermControl, then do we have the problem that the TermControl is going to want to link with Resources, and load them at runtime (even if the test doesn't have a TermControl in it?) yikes.
* [ ] Fix profile name generation to allocate unique name #9816
* [ ] `ControlInteractivity::CopySelectionToClipboard` returns false if there's no selection
* [ ] `ControlInteractivityTests::TestPanWithTouch` - does what it says on the label. Never got around to writing it.
* [ ] Serialize stub for dynamic profiles #9964
* [ ] Attempt to heal settings files damaged by #9962 #10143
* [x] Scrolling up, then trying to send mouse events shouldn't send VT (from https://github.com/microsoft/terminal/pull/10642#discussion_r673494665)
* [ ] Fix SSE2 variant of TextColor::GetColor #10867
* [ ] Monarch methods added in #10972 - `Monarch::SignalClose`, `Monarch::GetNumberOfPeasants`, creating and closing window events
* [ ] #11290
* [ ] #11325
* [ ] #11427
* [ ] #13706
* [ ] #5843
* [ ] https://github.com/microsoft/terminal/pull/15822#issuecomment-1679608265
* [ ] more...


## Feature / UI Tests

* [ ] #8183 As we move focus though panes, make sure the MRU order is updated
* [ ] #8183 Make sure that `exit`ing the "last" pane, then trying to MRU to it does the right thing (by going to the pane before it)
* [ ] #8183 Ensure that Pane IDs are assigned sensibly, and are moved correctly when a pane is closed
* [ ] #8549 / Closing a tab in focus mode causes terminal to become unresponsive #7916
* [ ] how #7180 interacts with #8610
* [ ] Introduce startupActions in settings #8770
  - This is a good one. Add a local test for setting startupActions, then verify the layout is as expected
  - Make sure that parsing these args with warnings results in warnings being added to the `AppLogic::_warnings`
    - and in the awrning case, that only a single tab is created
  - And test that providing args at the commandline will override this setting
* [ ] Tests to make sure that closing other tabs works as expected
* [ ] Tests to make sure "close tabs after" works as expected
* [ ] No idea how to test: "Fix settings not updating on reload #9289"
* [ ] That one time a fragment extension didn't define a `Public` folder, so it ended up being null, right around March 12th 2021
* [ ] #10806