Skip to content

Commit

Permalink
Revert "Converted Tags module jasmine file to jest test fixes publicl…
Browse files Browse the repository at this point in the history
…ab#787 (publiclab#788)"

This reverts commit 8f56721.
  • Loading branch information
RaviAnand111 committed Jan 21, 2022
1 parent 8f56721 commit c0ae1bb
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 40 deletions.
38 changes: 38 additions & 0 deletions spec/javascripts/tags_module_spec.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
var editor; var module;

describe("TagsModule", function() {
beforeAll(function() {
fixture = loadFixtures('index.html');

editor = new PL.Editor({
textarea: $('.ple-textarea')[0]
});

module = new PL.TagsModule(editor, {});
});


it("reports key, value, valid", function() {
expect(module).not.toBeUndefined();
expect(module.key).toBe('tags');

expect(module.value()).not.toBe(false);
expect(module.value()).toBe('');
module.value('cool,rad');
expect(module.value()).toBe('cool,rad');

expect(module.options.name).toBe('tags');
expect(module.options.required).toBe(false);

expect(module.valid()).toBe(true);
});


it("adds value to 'tags' key of editor.data, instead of overwriting it", function() {
expect(module.value()).toBe('cool,rad');
editor.data[module.key] = 'first';
expect(editor.data.hasOwnProperty(module.key)).toBe(true);
expect(editor.data[module.key]).toBe('first');
expect(module.value()).toBe('first,cool,rad');
});
});
40 changes: 0 additions & 40 deletions test/ui-testing/tags_module.test.js

This file was deleted.

0 comments on commit c0ae1bb

Please sign in to comment.