Skip to content

Commit

Permalink
Fix transition command forwarding wrong transitions (#395)
Browse files Browse the repository at this point in the history
* Fix transition command forwarding wrong transitions

* Bump cypress-xray-plugin from 7.4.0 to 7.4.1
  • Loading branch information
csvtuda authored Oct 31, 2024
1 parent 0842506 commit 91321ec
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 10 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Changelog

# `7.4.1`

## Notable changes

- Fix explicit transition call ([#389](https://github.com/Qytera-Gmbh/cypress-xray-plugin/pull/389))

# `7.4.0`

## Notable changes
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "cypress-xray-plugin",
"version": "7.4.0",
"version": "7.4.1",
"description": "A Cypress plugin for uploading test results to Xray (test management for Jira)",
"types": "index.d.ts",
"author": "csvtuda",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@ describe(path.relative(process.cwd(), __filename), () => {
"Transitioning test execution issue CYP-123"
);
expect(jiraClient.transitionIssue).to.have.been.calledOnceWithExactly("CYP-123", {
id: "5",
transition: {
id: "5",
},
});
});
});
Expand Down
11 changes: 5 additions & 6 deletions src/hooks/util/commands/jira/transition-issue-command.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { JiraClient } from "../../../../client/jira/jira-client";
import { IssueUpdate } from "../../../../types/jira/responses/issue-update";
import { IssueTransition } from "../../../../types/jira/responses/issue-transition";
import { Level, Logger } from "../../../../util/logging";
import { Command, Computable } from "../../../command";

interface Parameters {
jiraClient: JiraClient;
transition: Exclude<IssueUpdate["transition"], undefined>;
transition: IssueTransition;
}

export class TransitionIssueCommand extends Command<void, Parameters> {
Expand All @@ -25,9 +25,8 @@ export class TransitionIssueCommand extends Command<void, Parameters> {
Level.INFO,
`Transitioning test execution issue ${resolvedExecutionIssueKey}`
);
await this.parameters.jiraClient.transitionIssue(
resolvedExecutionIssueKey,
this.parameters.transition
);
await this.parameters.jiraClient.transitionIssue(resolvedExecutionIssueKey, {
transition: this.parameters.transition,
});
}
}

0 comments on commit 91321ec

Please sign in to comment.