forked from OscarGodson/EpicEditor
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest.edit.js
43 lines (34 loc) · 993 Bytes
/
test.edit.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
/*global createContainer:false, removeContainer:false, rnd:false */
describe('.edit()', function () {
var testEl
, id
, editor
, editEventFired;
before(function (done) {
id = rnd();
testEl = createContainer(id);
editor = new EpicEditor({ basePath: '/epiceditor/', container: testEl });
editEventFired = false;
editor.on('edit', function () {
editEventFired = true;
});
editor.load();
done();
});
after(function (done) {
editor.removeListener('edit');
editor.unload();
removeContainer(id);
done();
});
it('should fire the edit event', function () {
editor.edit();
expect(editEventFired).to.be(true);
});
it('should make the editor visible when switching from preview back to edit', function () {
editor.preview();
editor.edit();
expect(editor.getElement('previewerIframe').style.left).to.be('-999999px');
expect(editor.getElement('editorIframe').style.left).to.be('');
});
});