Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Converts web apps specs to ESM #35735

Merged
merged 2 commits into from
Feb 6, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Add missing test back into main.js
  • Loading branch information
MartinRiese committed Feb 4, 2025
commit b39c9372d3baad232f44c6e91a8883309a4f8b4f
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import "cloudcare/js/formplayer/spec/debugger_spec";
import "cloudcare/js/formplayer/spec/hq_events_spec";
import "cloudcare/js/spec/markdown_spec";
import "cloudcare/js/formplayer/spec/menu_list_spec";
import "cloudcare/js/formplayer/spec/menu_utils_spec";
import "cloudcare/js/formplayer/spec/query_spec";
import "cloudcare/js/formplayer/spec/session_middleware_spec";
import "cloudcare/js/formplayer/spec/split_screen_case_search_spec";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,83 +1,79 @@
hqDefine("cloudcare/js/formplayer/spec/menu_utils_spec", [
"cloudcare/js/formplayer/menus/views/query",
], function (
view,
) {
describe('Menu Utils', function () {
import view from "cloudcare/js/formplayer/menus/views/query";

describe('groupDisplays', function () {
it('should return the displays grouped by their groupKey', function () {
const displays = [
{
"text": "Facility Name",
"groupKey": "facility",
},
{
"text": "Facility Address",
"groupKey": "facility",
},
{
"text": "Unit Name",
"groupKey": "unit",
},
{
"text": "Floor",
"groupKey": "unit",
},
{
"text": "Capacity",
"groupKey": "unnamed",
},
];
const groupHeaders = {
"unit": "Unit",
"facility": "Facility",
"unnamed": "",
};
const grouped = view.groupDisplays(displays, groupHeaders);
const expected = [
{
"groupKey": "facility",
"groupName": "Facility",
"displays": [
{
"text": "Facility Name",
"groupKey": "facility",
},
{
"text": "Facility Address",
"groupKey": "facility",
},
],
},
{
"groupKey": "unit",
"groupName": "Unit",
"displays": [
{
"text": "Unit Name",
"groupKey": "unit",
},
{
"text": "Floor",
"groupKey": "unit",
},
],
},
{
"groupKey": "unnamed",
"groupName": "",
"displays": [
{
"text": "Capacity",
"groupKey": "unnamed",
},
],
},
];
assert.deepEqual(JSON.stringify(expected), JSON.stringify(grouped));
});
describe('Menu Utils', function () {

describe('groupDisplays', function () {
it('should return the displays grouped by their groupKey', function () {
const displays = [
{
"text": "Facility Name",
"groupKey": "facility",
},
{
"text": "Facility Address",
"groupKey": "facility",
},
{
"text": "Unit Name",
"groupKey": "unit",
},
{
"text": "Floor",
"groupKey": "unit",
},
{
"text": "Capacity",
"groupKey": "unnamed",
},
];
const groupHeaders = {
"unit": "Unit",
"facility": "Facility",
"unnamed": "",
};
const grouped = view.groupDisplays(displays, groupHeaders);
const expected = [
{
"groupKey": "facility",
"groupName": "Facility",
"displays": [
{
"text": "Facility Name",
"groupKey": "facility",
},
{
"text": "Facility Address",
"groupKey": "facility",
},
],
},
{
"groupKey": "unit",
"groupName": "Unit",
"displays": [
{
"text": "Unit Name",
"groupKey": "unit",
},
{
"text": "Floor",
"groupKey": "unit",
},
],
},
{
"groupKey": "unnamed",
"groupName": "",
"displays": [
{
"text": "Capacity",
"groupKey": "unnamed",
},
],
},
];
assert.deepEqual(JSON.stringify(expected), JSON.stringify(grouped));
});

});
});
Loading