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

Stacks class testing #17

Merged
merged 13 commits into from
Aug 18, 2017
Merged

Stacks class testing #17

merged 13 commits into from
Aug 18, 2017

Conversation

laurengastineau
Copy link
Contributor

Updated:

  • Draggability and droppability tests for app/cards.js are now uncommented and are run in test/card-test.js
  • Added buttons (close, save, fullscreen mode) to card class app/cards.js.

Added:

  • test/stacks.js provides basic testing infrastructure for ensuring that a stack instance is set up correctly.

Stack tests check:

  • A stack contains the following content:
    • Body div, close button, expand button, annotation text field
  • A stack instance tracks its contained cards.
  • A stack instance is collapsed by default.
  • Multiple stack instances can be created.
  • Multiple stack instances track different sets of cards.
  • Cards can be removed from a stack instance.
  • Cards are positioned correctly in a stack instance. (This test is currently commented out for now.)

Copy link
Member

@nelsonni nelsonni left a comment

Choose a reason for hiding this comment

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

Changes related to test updates/removals must be resolved before approval.

// assert.notEqual(card.saveButton, undefined, msg2);
// assert.notEqual(card.fullscreenButton, undefined, msg3);
// });
it('document contains close, expand, and save buttons', function () {
Copy link
Member

Choose a reason for hiding this comment

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

Testing for the existence of elements within an instance of the Card class does not test behavior, but instead tests the definition of the Card class. This definition could change in the future and still remain a valid Card, however, this test would indicate a change in structure is invalid. I suggest removing this test.

// var disabled = 1;
// return assert.equal(disabled, 1);
// });
it('card dragability can be disabled', function () {
Copy link
Member

Choose a reason for hiding this comment

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

Testing whether a local variable (disabled) equals 1 after evaluating an if statement which limits that variable from being declared only when a Card class instance allows the jquery-ui.draggable('disable') command is a masked testing methodology. Since the ability to disable draggability is inherited from the jquery-ui package, this test is actually evaluating the functionality of that package. Tests need to focus on evaluating the functionality of the synectic app.

// var disabled = 1;
// return assert.equal(disabled, 1);
// });
it('card dropability can be disabled', function () {
Copy link
Member

Choose a reason for hiding this comment

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

Similar to my comments on line 124, the jquery-ui.droppable('disable') command is a functionality provided by jquery-ui package. No need to test jquery-ui within our app; that type of testing should be handled by the developers of jquery-ui within their package.

var Canvas = require('../app/Canvas.js');
var Stack = require('../app/Stacks.js');

var app = new Application({
Copy link
Member

Choose a reason for hiding this comment

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

This declaration of app is masked by the declaration of another app on line 25. Therefore, this declaration can be removed.

@nelsonni nelsonni changed the title Stacks class tesing Stacks class testing Aug 17, 2017
@nelsonni nelsonni added the feature Feature requests or improvements label Aug 18, 2017
@nelsonni
Copy link
Member

nelsonni commented Aug 18, 2017

The stacks-class-testing branch appears to be slightly behind the master branch to which this pull request is attempting to merge onto (3 commits behind). Prior to being able to integrate this PR, the following commits need to be pulled into the stacks-class-testing branch: f2e68a2, 8dd84fd, and aabd16c.

…nges for test/card-test.js, a stack is now created when a card is dropped onto another card
@laurengastineau
Copy link
Contributor Author

In my last commit I was mistaken. I have not competed every PR requests for app/card-test.js. I have removed the test that checks for buttons on a card instance, but I am still working on creating a test that checks that a card can be dragged and dropped.

@nelsonni nelsonni merged commit 819ac21 into master Aug 18, 2017
@nelsonni nelsonni deleted the stacks-class-tesing branch August 18, 2017 21:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature Feature requests or improvements
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants