Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failing tests on the main branch #140

Closed
timrogers opened this issue Jun 30, 2022 · 0 comments · Fixed by #143
Closed

Failing tests on the main branch #140

timrogers opened this issue Jun 30, 2022 · 0 comments · Fixed by #143

Comments

@timrogers
Copy link
Contributor

There are currently two failing tests on the main branch - at least on my machine.

The output is below:

> @actions/add-to-project@0.0.0 test
> jest

 FAIL  __tests__/add-to-project.test.ts
  addToProject
    ✓ adds an issue to the project (2 ms)
    ✓ adds matching issues with a label filter without label-operator
    ✓ adds matching pull-requests with a label filter without label-operator
    ✓ does not add un-matching issues with a label filter without label-operator (1 ms)
    ✓ adds matching issues with labels filter with AND label-operator
    ✓ does not add un-matching issues with labels filter with AND label-operator
    ✓ does not add matching issues with labels filter with NOT label-operator
    ✕ adds issues that do not have labels present in the label list with NOT label-operator (1 ms)
    ✓ adds matching issues with multiple label filters
    ✓ does not add un-matching issues with multiple label filters
    ✓ handles spaces and extra commas gracefully in label filter input
    ✓ throws an error when url isn't a valid project url (5 ms)
    ✓ throws an error when url isn't under the github.com domain (1 ms)
    ✓ constructs the correct graphQL query given an organization owner
    ✓ constructs the correct graphQL query given a user owner
    ✕ compares labels case-insensitively
  mustGetOwnerTypeQuery
    ✓ returns organization for orgs ownerType
    ✓ returns user for users ownerType
    ✓ throws an error when an unsupported ownerType is set (1 ms)

  ● addToProject › adds issues that do not have labels present in the label list with NOT label-operator

    TypeError: Cannot read properties of undefined (reading 'id')

       96 |   )
       97 |
    >  98 |   const projectId = idResp[ownerTypeQuery]?.projectV2.id
          |                                                       ^
       99 |   const contentId = issue?.node_id
      100 |
      101 |   core.debug(`Project node ID: ${projectId}`)

      at src/add-to-project.ts:98:55
      at fulfilled (src/add-to-project.ts:28:58)

  ● addToProject › compares labels case-insensitively

    TypeError: Cannot read properties of undefined (reading 'id')

       96 |   )
       97 |
    >  98 |   const projectId = idResp[ownerTypeQuery]?.projectV2.id
          |                                                       ^
       99 |   const contentId = issue?.node_id
      100 |
      101 |   core.debug(`Project node ID: ${projectId}`)

      at src/add-to-project.ts:98:55
      at fulfilled (src/add-to-project.ts:28:58)

Test Suites: 1 failed, 1 total
Tests:       2 failed, 17 passed, 19 total
Snapshots:   0 total
Time:        1.218 s, estimated 2 s
Ran all test suites.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant