Skip to content

Commit

Permalink
💥 rename 'tray' action to 'toggle-tray'
Browse files Browse the repository at this point in the history
  • Loading branch information
francisashley committed Dec 16, 2019
1 parent c297a3e commit 83eca2d
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/mde.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import tracer from "./utils/tracer.js";

defaults(options, {
stateId: "global",
actions: ["reload", "tray"],
actions: ["reload", "toggle-tray"],
hardReload: true,
actionsCorner: "tr"
});
Expand Down Expand Up @@ -121,15 +121,15 @@ import tracer from "./utils/tracer.js";
ActionBar({
corner: state.get("action-bar.corner"),
showReload: state.get("action-bar").includes("reload"),
showTray: state.get("action-bar").includes("tray"),
showTray: state.get("action-bar").includes("toggle-tray"),
shouldRefreshCache: state.get("reload.refreshCache"),
trayIsOpen: state.getCache("tray.open"),
onToggleTray: toggleTray
})
);

// render tray
if (state.get("action-bar").includes("tray")) {
if (state.get("action-bar").includes("toggle-tray")) {
crel(
root,
Tray({
Expand Down
12 changes: 12 additions & 0 deletions src/mde.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,3 +67,15 @@ test("MDE console.assert()'s to tray", () => {
.innerHTML
).toBe("2");
});

test("MDE shows correct actions", () => {
mobileDevEnvironment({
actions: ["reload", "toggle-tray"]
});

expect(document.querySelector("#mde-action-bar #mde-reload")).toBeTruthy();
expect(document.querySelector("#mde-action-bar #mde-toggle-tray")).toBeTruthy();
});

test.todo("MDE shows actions tray on top left");
test.todo("MDE shows actions tray on top right");

0 comments on commit 83eca2d

Please sign in to comment.