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

Add js tests for wiring connections #236

Merged
merged 3 commits into from
Oct 13, 2016

Conversation

jpajuelo
Copy link
Collaborator

@jpajuelo jpajuelo commented Oct 7, 2016

No description provided.

Copy link
Member

@aarranz aarranz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Update the pull request, as there are conflicts, and address the requested changes.

@@ -26,9 +26,9 @@

"use strict";

// =========================================================================
// ==================================================================================
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Breaks code style

// CLASS DEFINITION
// =========================================================================
// ==================================================================================
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Breaks code style

}

});

// =========================================================================
// ==================================================================================
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Breaks code style

// PRIVATE MEMBERS
// =========================================================================
// ==================================================================================
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Breaks code style

@@ -44,178 +44,145 @@
* @param {Wiring} wiringEngine
* [TODO: description]
*/
ns.Connection = utils.defineClass({
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

one defineClass less 👍


describe("remove()", function () {

it("should remove after disconnecting endpoints", function () {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"should disconnect the connection"

});
});

describe("remove()", function () {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing tests removing a disconnected connection

expect(callback.calls.count()).toEqual(1);
});

it("should ignore if one of their endpoints is missing", function () {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Split into two tests:

"should do nothing if the source is a ghost endpoint"
"should do nothing if the target is a ghost endpoint"

expect(callback.calls.count()).toEqual(1);
});

it("should ignore if connection is established", function () {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"should do nothing if the connection is already established"

var callback = jasmine.createSpy("callback");

connection.addEventListener("establish", callback);
connection.establish();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

establish should support method chaining. Change this line to:

expect(connection.establish()).toBe(connection);

@jpajuelo jpajuelo force-pushed the feature/wiring-connections-tests branch from dcc33b8 to c85df8f Compare October 11, 2016 12:16
@aarranz aarranz merged commit f1415e4 into Wirecloud:develop Oct 13, 2016
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.

2 participants