Skip to content
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

Merged
merged 4 commits into from Jul 13, 2019
Merged

Tests #78

merged 4 commits into from Jul 13, 2019

Conversation

VizuaaLOG
Copy link
Owner

Add some initial tests ... more to follow

Bulma.each(elements, (element) => {
Bulma(element).data('testplugin', new TestPlugin({ element: element }));
});
};
Copy link

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 }));
Copy link

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) => {
Copy link

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'; }
Copy link

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 {
Copy link

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) {
Copy link

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');
Copy link

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']);
Copy link

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');
Copy link

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) {
Copy link

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

@VizuaaLOG VizuaaLOG merged commit 771e8d0 into master Jul 13, 2019
@VizuaaLOG VizuaaLOG deleted the tests branch July 13, 2019 21:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant