chore: non-functional improvements to /fix source action

Description

Applies two of the non-blocking suggestions from !2585 (merged)

  • simplifies the way we return multiple actions

Instead of filtering out the undefined value, then type casting the array (because typescript doesn't understand that .filter(Boolean) results in an array without undefined) we now simply use a ternary to check the value and conditionally return.

  • improve tests by using appropriate jest matchers

Instead of unpacking the action object and checking specific nested properties, we now use appropriate jest macthers to verify the overall shape of the action.

Related Issues

Resolves #1963 (closed)

How has this been tested?

No functiuonal changes expected. Code build,s tests pass, source code-action still works.

  • If src/browser or src/common has been modified, please consider interoperability with the Web IDE. See Running the Extension in WebIDE.
  • Consider an end-to-end test for significant new features that aren't covered by integration tests.

Screenshots (if appropriate)

What CHANGELOG entry will this MR create?

  • fix: Bug fix fixes - a user-facing issue in production - included in changelog
  • feature: New feature - a user-facing change which adds functionality - included in changelog
  • BREAKING CHANGE: (fix or feature that would cause existing functionality to change) - should bump major version, mentioned in the changelog
  • None - other non-user-facing changes

Closes #1963 (closed)

Merge request reports

Loading
Loading