tests: Add integration tests for deleted boards/cards
Signed-off-by: Julius Härtl <jus@bitgrid.net>
This commit is contained in:
@@ -11,6 +11,8 @@ class CommentContext implements Context {
|
||||
/** @var BoardContext */
|
||||
protected $boardContext;
|
||||
|
||||
private $lastComment = null;
|
||||
|
||||
/** @BeforeScenario */
|
||||
public function gatherContexts(BeforeScenarioScope $scope) {
|
||||
$environment = $scope->getEnvironment();
|
||||
@@ -27,5 +29,34 @@ class CommentContext implements Context {
|
||||
'message' => $content,
|
||||
'parentId' => null
|
||||
]);
|
||||
$this->lastComment = $this->requestContext->getResponseBodyFromJson()['ocs']['data'] ?? null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @Given /^get the comments on the card$/
|
||||
*/
|
||||
public function getCommentsOnTheCard() {
|
||||
$card = $this->boardContext->getLastUsedCard();
|
||||
$this->requestContext->sendOCSRequest('GET', '/apps/deck/api/v1.0/cards/' . $card['id'] . '/comments');
|
||||
}
|
||||
|
||||
/**
|
||||
* @When /^update a comment with content "([^"]*)" on the card$/
|
||||
*/
|
||||
public function updateACommentWithContentOnTheCard($content) {
|
||||
$card = $this->boardContext->getLastUsedCard();
|
||||
$this->requestContext->sendOCSRequest('PUT', '/apps/deck/api/v1.0/cards/' . $card['id'] . '/comments/'. $this->lastComment['id'], [
|
||||
'message' => $content,
|
||||
'parentId' => null
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @When /^delete the comment on the card$/
|
||||
*/
|
||||
public function deleteTheCommentOnTheCard() {
|
||||
$card = $this->boardContext->getLastUsedCard();
|
||||
$this->requestContext->sendOCSRequest('DELETE', '/apps/deck/api/v1.0/cards/' . $card['id'] . '/comments/'. $this->lastComment['id']);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user