vinyldns / vinyldns/vinyldns-cli

Add test for batch change create response

Open
#80 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Go
Stars
6
Forks
25
PR merge metrics
No merged PRs in 30d

Description

Wer're only validating the status currently because the output and fixture formatting are not matching.

Intended test was:

@test "batch-change-create" {
  run $ew batch-change-create \
    --json "$(cat tests/fixtures/batch_change_create_json)"

  fixture="$(cat tests/fixtures/batch_change_create)"

  [ "$status" -eq 0 ]
  [ "${output}" = "${fixture}" ]
}

The most recent iteration of the the batch_change_create fixture I made was:

+--------------------+-------------------------------+
| ID                 |
+--------------------+-------------------------------+
| UserName           |
+--------------------+-------------------------------+
| UserID             |
+--------------------+-------------------------------+
| Status             | PendingProcessing             |
+--------------------+-------------------------------+
| Comments           | request on behalf of someone. |
+--------------------+-------------------------------+
| Changes            |
|                    |
|                    |
|                    |
|                    |
|                    |
|                    |
|                    |
|                    |
|                    |
+--------------------+-------------------------------+
| CreatedTimestamp   |
+--------------------+-------------------------------+
| OwnerGroupID       |
+--------------------+-------------------------------+
| ApprovalStatus     | AutoApproved                  |
+--------------------+-------------------------------+
| ReviewerID         |                               |
+--------------------+-------------------------------+
| ReviewerUserName   |                               |
+--------------------+-------------------------------+
| ReviewerTimestamp  |                               |
+--------------------+-------------------------------+
| ReviewComment      |                               |
+--------------------+-------------------------------+
| ScheduledTime      |                               |
+--------------------+-------------------------------+
| CancelledTimestamp |                               |
+--------------------+-------------------------------+

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the intended batch-change-create test and the fixtures at tests/fixtures/batch_change_create_json and tests/fixtures/batch_change_create. Run the command shown in the issue, compare its output with the fixture, and update the test fixture or formatting so the status and exact output assertions pass.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
cli, testing-qa
Issue type
Feature
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.