Skip to content

Commit

Permalink
added unit test for template id with missing package reference
Browse files Browse the repository at this point in the history
  • Loading branch information
= committed May 6, 2024
1 parent 66ed71d commit e112a7d
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ damlStart tmpDir _disableUpgradeValidation = do
(authorizationHeaders "Alice") -- dummy party here, not important
scriptOutput <- readFileUTF8 (projDir </> scriptOutputFile)
let alice = (read scriptOutput :: String)
-- TODO(raphael-speyer-da): Use a package name once fully supported.
-- TODO(raphael-speyer-da): Use a package name once supported by canton out of the box.
let packageRef = "6310b9aa3d506211b592dd657afb167d63637453f31eae986fad5aa1b6d61401"
pure $
DamlStartResource
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -533,6 +533,28 @@ abstract class QueryStoreAndAuthDependentIntegrationTest
}
}

"query with package reference missing from Template IDs" - {
"fails if any have package reference missing" in withHttpService { fixture =>
fixture.getUniquePartyAndAuthHeaders("Alice").flatMap { case (alice, headers) =>
search(
genSearchDataSet(alice),
jsObject(
s"""{"templateIds": ["${TpId.Account.Account.fqn}", "Iou:Iou"], "query": {"currency": "EUR"}}"""
),
fixture,
headers,
).map { response =>
inside(response) {
case domain.ErrorResponse(List(error), None, StatusCodes.BadRequest, _) =>
error should include(
"Expected JsString(<packageId>:<module>:<entity>), got: \"Iou:Iou\""
)
}
}
}
}
}

private def postCreate(
fixture: HttpServiceTestFixtureData,
payload: JsValue,
Expand Down

0 comments on commit e112a7d

Please sign in to comment.