Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions store/postgres/asset_repository_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -170,24 +170,24 @@ func (r *AssetRepositoryTestSuite) TestBuildFilterQuery() {
expectedQuery: `(data->'landscape'->'properties'->>'project-id' ILIKE $1 OR description ILIKE $2)`,
},
{
// NOTE: Cannot have more than one key in map because golang's map does not guarantee order thus producing
// inconsistent test.
description: "should return sql query with asset's data fields filter",
config: asset.Filter{
Data: map[string]string{
"entity": "odpf",
"country": "th",
"entity": "odpf",
},
},
expectedQuery: `data->>'entity' = 'odpf' AND data->>'country' = 'th'`,
expectedQuery: `data->>'entity' = 'odpf'`,
},
{
description: "should return sql query with asset's nested data fields filter",
config: asset.Filter{
Data: map[string]string{
"landscape.properties.project-id": "compass_001",
"country": "vn",
},
},
expectedQuery: `data->'landscape'->'properties'->>'project-id' = 'compass_001' AND data->>'country' = 'vn'`,
expectedQuery: `data->'landscape'->'properties'->>'project-id' = 'compass_001'`,
},
}

Expand Down