CE-881 - Formalize savedReport.columnsJSON as a ReportColumns class.

This commit is contained in:
2024-03-29 09:06:16 -05:00
parent 52b64ffbc0
commit 5384eb9927
6 changed files with 312 additions and 105 deletions

View File

@ -64,19 +64,24 @@ class RenderSavedReportProcessTest extends BaseTest
String label = "Test Report";
//////////////////////////////////////////////////////////////////////////////////////////
// do columns json as a string, rather than a toJson'ed ReportColumns object, //
// to help verify that we don't choke on un-recognized properties (e.g., as QFMD sends) //
//////////////////////////////////////////////////////////////////////////////////////////
String columnsJson = """
{"columns":[
{"name": "k"},
{"name": "id"},
{"name": "firstName", "isVisible": true},
{"name": "lastName", "pinned": "left"},
{"name": "createDate", "isVisible": false}
]}
""";
QRecord savedReport = new InsertAction().execute(new InsertInput(SavedReport.TABLE_NAME).withRecordEntity(new SavedReport()
.withLabel(label)
.withTableName(TestUtils.TABLE_NAME_PERSON_MEMORY)
.withColumnsJson("""
{
"columns":
[
{"name": "id"},
{"name": "firstName"},
{"name": "lastName"}
]
}
""")
.withColumnsJson(columnsJson)
.withQueryFilterJson(JsonUtils.toJson(new QQueryFilter()))
)).getRecords().get(0);