New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Tests #78
Conversation
Bulma.each(elements, (element) => { | ||
Bulma(element).data('testplugin', new TestPlugin({ element: element })); | ||
}); | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unnecessary semicolon no-extra-semi
let elements = context.querySelectorAll('.testplugin'); | ||
|
||
Bulma.each(elements, (element) => { | ||
Bulma(element).data('testplugin', new TestPlugin({ element: element })); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'Bulma' is not defined no-undef
static parseDocument(context) { | ||
let elements = context.querySelectorAll('.testplugin'); | ||
|
||
Bulma.each(elements, (element) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'Bulma' is not defined no-undef
|
||
function createTestPlugin() { | ||
Bulma.registerPlugin('testplugin', class TestPlugin { | ||
static create(config) { return 'testplugin'; } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'config' is defined but never used no-unused-vars
} | ||
|
||
function createTestPlugin() { | ||
Bulma.registerPlugin('testplugin', class TestPlugin { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'Bulma' is not defined no-undef
assert.ok(myElement3 instanceof HTMLElement, 'The new element is created and returned as it does not exist.'); | ||
}); | ||
|
||
QUnit.test('The stripScripts method will remove any scripts from the string', function(assert) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'QUnit' is not defined no-undef
|
||
let myElement3 = Bulma.findOrCreateElement('.elementmissing', document.body, 'div', ['myelement3']); | ||
|
||
assert.equal(Bulma.findOrCreateElement('.myelement2'), myElement2, 'The existing element is returned without creating a new one'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'Bulma' is not defined no-undef
let myElement2 = testCreateElem('div', 'myelement2'); | ||
document.body.appendChild(myElement2); | ||
|
||
let myElement3 = Bulma.findOrCreateElement('.elementmissing', document.body, 'div', ['myelement3']); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'Bulma' is not defined no-undef
}); | ||
|
||
QUnit.test('The findOrCreateElement method will return an existing element, or create a new one', function(assert) { | ||
let myElement2 = testCreateElem('div', 'myelement2'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'testCreateElem' is not defined no-undef
assert.ok(myElement.classList.contains('testclass2'), 'The second class is added to the element.'); | ||
}); | ||
|
||
QUnit.test('The findOrCreateElement method will return an existing element, or create a new one', function(assert) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'QUnit' is not defined no-undef
Add some initial tests ... more to follow