message: collapse mutator
diff: import browserHandler from 'browser/api/classes/Handler'
  import mainHandler, { passthrough } from 'main/api/classes/Handler'
  import { Mutator } from 'api/types'
  -import loadingID from 'api/constants/loadingID'
  -import { hasID } from 'api/helpers/hasID'
  +import { mutator as setActiveTest } from './setActiveTest'
  export type Shape = (suiteID: string) => Promise<void>
  @@ -10,21 +9,16 @@ export const mutator: Mutator<Shape> = (
  session,
  { params: [activeSuiteID] }
  ) => {
  - const activeTestID =
  - session.project.suites.find(hasID(activeSuiteID))?.tests?.[0] ??
  - loadingID
  - return {
  - ...session,
  - state: {
  - ...session.state,
  - editor: {
  - ...session.state.editor,
  - selectedCommandIndexes: [0],
  - },
  - activeSuiteID,
  - activeTestID,
  - },
  + const { suites } = session.project
  + const activeSuite =
  + suites.find((suite) => suite.id === activeSuiteID) || suites[0]
  + return setActiveTest(
  + { ...session, state: { ...session.state, activeSuiteID } },
  + {
  + params: [activeSuite.tests[0]],
  + result: undefined,
  }
  + )
  }
  export const browser = browserHandler<Shape>()
  