Skip to content

Commit

Permalink
Add init tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Gomez authored and thet committed Jan 8, 2021
1 parent d621b7a commit 712e6e5
Showing 1 changed file with 53 additions and 0 deletions.
53 changes: 53 additions & 0 deletions src/pat/toolbar/toolbar.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
import $ from "jquery";
import Pattern from "./toolbar";

describe("Backdrop", function () {
it("default behaviour", function () {
var $el = $('<div id="edit-zone">' +
' <div class="pat-toolbar" />' +
'</div>'),
toolbar = new Pattern($el);
expect($(".plone-backdrop", $el).length).toEqual(1);
});
});

/*
define([
"expect",
"jquery",
"pat-registry",
"plone-patterns-toolbar",
], function (expect, $, registry, Toolbar) {
"use strict";
window.mocha.setup("bdd");
$.fx.off = true;
describe("Plone Toolbar", function () {
beforeEach(function () {
this.$el = $(
"" +
'<div id="edit-zone">' +
' <div class="pat-toolbar" />' +
"</div>"
).appendTo($("body"));
});
afterEach(function () {
$("body").empty();
this.$el.remove();
this.pattern = null;
});
it("Initializes", function () {
registry.scan(this.$el);
// check if toolbar was initialized.
expect(this.$el.find(".pat-toolbar.initialized").length).to.equal(
1
);
// TODO: more and better tests.
});
});
});
*/

0 comments on commit 712e6e5

Please sign in to comment.