Skip to content

Commit

Permalink
feat: apply component state configuration in postLaunchHook()
Browse files Browse the repository at this point in the history
  • Loading branch information
ThorstenSuckow committed Feb 18, 2023
1 parent fa04b3c commit 74c11af
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/app/PackageController.js
Original file line number Diff line number Diff line change
Expand Up @@ -1055,7 +1055,12 @@ Ext.define("conjoon.cn_mail.app.PackageController", {
cls: "toggleFolderViewBtn",
itemId: "cn_mail-nodeNavToggleFolder",
enableToggle: true,
pressed: true
pressed: true,
stateId: "cn_mail-nodeNavToggleFolder",
stateEvents: ["click"],
stateful: {
pressed: true
}
}, {
xtype: "button",
iconCls: "fas fa-list",
Expand Down
15 changes: 15 additions & 0 deletions tests/src/app/PackageControllerTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,21 @@ StartTest(async t => {
});


t.it("postLaunchHook() applies component state configuration", t => {
packageCtrl = Ext.create("conjoon.cn_mail.app.PackageController");
const nodeNav = packageCtrl.postLaunchHook().navigation[0].nodeNav;

t.expect(nodeNav.some(node => {
if (node.itemId === "cn_mail-nodeNavToggleFolder") {
t.expect(node.stateId).toBe("cn_mail-nodeNavToggleFolder");
t.expect(node.stateEvents).toEqual(["click"]);
t.expect(node.stateful.pressed).toBe(true);
return true;
}
})).toBe(true);
});


t.it("onActiveMailAccountAvailable()", t => {

const FAKE_STORE = {};
Expand Down

0 comments on commit 74c11af

Please sign in to comment.