Skip to content

[Backlog] Test-quality: harden ConvertTo-JiraFilter FilterPermissions coverage #680

Description

@lipkau

Problem

ConvertTo-JiraFilter.Unit.Tests.ps1 covers FilterPermissions, but the fixture and mock setup are easy to misread and previously hid scope-related behavior during the type-system PR4 work.

The converter now needs to prove three distinct paths clearly:

  • Explicit -FilterPermissions input is preferred over payload share permissions.
  • Payload sharePermissions are converted when no explicit filter permissions are supplied.
  • Missing permissions produce an empty AtlassianPS.JiraPS.FilterPermission[] rather than an untyped or scalar value.

Proposal

Refactor the ConvertTo-JiraFilter unit tests so each FilterPermissions scenario has isolated setup and assertions.
Avoid broad mocks that return loosely typed placeholder objects unless the test is explicitly about mock behavior.
Prefer real ConvertTo-JiraFilterPermission output or tightly scoped mocks that assert the input source.

Acceptance criteria

  • ConvertTo-JiraFilter.Unit.Tests.ps1 has separate examples for explicit -FilterPermissions, payload sharePermissions, and no permissions.
  • Each example asserts the resulting FilterPermissions slot is AtlassianPS.JiraPS.FilterPermission[] with the expected item count and values.
  • Tests fail if the converter accidentally ignores explicit permissions, falls back to the wrong source, or returns an untyped array/scalar.
  • Invoke-Build -Task Build, Test passes.

Related items

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Area:TestBacklogFiled for tracking; not yet scheduledIssue:MetaTheme:TestsTest infrastructure / fixture / integration-suite work

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions