Skip to content

Commit a8efbac

Browse files
authored
test: fix TestQueryCreateFromEditor and TestComponent* (#1594)
* test: fix lql tests * test: revert spaces * fix: test cdk components
1 parent 9e12df9 commit a8efbac

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

cli/cmd/lql.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,8 @@ func inputQueryFromURL(url string) (query string, err error) {
298298

299299
func inputQueryFromEditor(action string) (query string, err error) {
300300
language := "LQL"
301-
if action == "create" && !queryCmdState.EmptyTemplate && cli.LwApi.V2.Query.RegoQueryEnabled() {
301+
regoQueryEnabled := os.Getenv("LW_CLI_INTEGRATION_MODE") != "" || cli.LwApi.V2.Query.RegoQueryEnabled()
302+
if action == "create" && !queryCmdState.EmptyTemplate && regoQueryEnabled {
302303
languageSelect := &survey.Select{
303304
Message: "Choose query language: ",
304305
Options: []string{
@@ -400,7 +401,7 @@ Verify that the JSON is formatted properly and adheres to the following schema:
400401
}
401402
// smells like plain text
402403
return errors.New(`invalid query
403-
404+
404405
It looks like you attempted to submit a query in YAML format.
405406
Verify that the text adheres to the following schema:
406407

lwcomponent/catalog.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@ const (
2323
)
2424

2525
func CatalogV1Enabled(client *api.Client) bool {
26+
if os.Getenv("LW_CLI_INTEGRATION_MODE") != "" {
27+
return true
28+
}
2629
response, err := client.V2.FeatureFlags.GetFeatureFlagsMatchingPrefix(featureFlag)
2730
if err != nil {
2831
return false

0 commit comments

Comments
 (0)