cli/pkg/cmd/project/shared/format/display_test.go
Heath Stewart 0cf5d22ead
Support template, jq flags with standard format flag (#7832)
* Use standard JSON flags for project command

Deprecates the --format flag and adds the standard JSON flags to properly filter, template, and write JSON.

* Add format flags cmdutil

Resolves PR feedback

* Remove unnecessary fields from JSON format flags

* Add standard format help to remaining commands

* Add JSON format regression tests

Also fixed a number of `project` commands that didn't format the right object as JSON.

* Resolve PR feedback
2024-01-09 09:46:39 -08:00

18 lines
498 B
Go

package format
import (
"testing"
"github.com/cli/cli/v2/pkg/cmd/project/shared/queries"
"github.com/stretchr/testify/assert"
)
func TestProjectState(t *testing.T) {
assert.Equal(t, "open", ProjectState(queries.Project{}))
assert.Equal(t, "closed", ProjectState(queries.Project{Closed: true}))
}
func TestColorForProjectState(t *testing.T) {
assert.Equal(t, "green", ColorForProjectState(queries.Project{}))
assert.Equal(t, "gray", ColorForProjectState(queries.Project{Closed: true}))
}