Skip to content

Commit

Permalink
Add test
Browse files Browse the repository at this point in the history
  • Loading branch information
oxixes committed Aug 15, 2024
1 parent 0ad8d66 commit 952b9c3
Showing 1 changed file with 22 additions and 2 deletions.
24 changes: 22 additions & 2 deletions src/js_tests/wirecloud/ui/WorkspaceTabViewDragboardSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,13 @@

"use strict";

const create_tab = function () {
const create_tab = function (customPreferences = null) {
return {
appendChild: jasmine.createSpy("appendChild"),
model: {
id: 3,
preferences: {
get: jasmine.createSpy("get").and.returnValue({
get: jasmine.createSpy("get").and.returnValue(customPreferences || {
"type": "gridlayout",
"columns": 20
})
Expand Down Expand Up @@ -871,6 +871,26 @@

});

describe("updateWidgetScreenSizeWithId", () => {

it("should update the screen size of the widget with the given id", () => {
const tab = create_tab([
{
"id": 1,
"moreOrEqual": 0,
"lessOrEqual": 800
}
]);
const dragboard = new ns.WorkspaceTabViewDragboard(tab);
dragboard.updateWidgetScreenSize = jasmine.createSpy("updateWidgetScreenSize");

dragboard.updateWidgetScreenSizeWithId(1);

expect(dragboard.updateWidgetScreenSize).toHaveBeenCalledWith(400);
});

});

describe("update([ids, allLayoutConfigurations])", () => {

let dragboard, widget1, widget2, widget3;
Expand Down

0 comments on commit 952b9c3

Please sign in to comment.