-
Notifications
You must be signed in to change notification settings - Fork 0
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
Card class testing #8
Conversation
…rd-class-testing
… styling of code.
…eEditor), and canvas class.
…rd-class-testing
@laurengastineau Travis CI is currently showing failed builds for both Node.js versions 1) canvas interactions "before all" hook:
Error: Cannot find module 'jsdom-global'
at require (internal/module.js:11:18)
at Context.<anonymous> (test/canvas-test.js:18:18)
2) cards interactions "before all" hook:
Error: Cannot find module 'jsdom-global'
at require (internal/module.js:11:18)
at Context.<anonymous> (test/card-test.js:23:18) I suspect that running these same tests on your own machine did not result in any failures because you have installed the When introducing new packages to the project, you need to also update the Also, #6 introduces those same packages to the project. Look at the |
The latest Travis CI build (Build #29) is failing because of a broken merge between There is code in constructor({
id = Error.throwIfMissing('id'),
context = Error.throwIfMissing('context'),
modal = true
}) {
this.id = id;
this.createdBy = require('username').sync();
this.createdTimestamp = new Date();
this.lastInteraction = new Date();
this.card = document.createElement('div');
$(this.card).attr({
id: this.id,
class: 'card',
});
this.header = document.createElement('div');
$(this.header).attr('class', 'card-header');
this.title = document.createElement('span');
$(this.title).html("My Card");
this.header.appendChild(this.title);
this.card.appendChild(this.header);
context.appendChild(this.card);
if (modal) this.toggleDraggable();
}
//for metadata
this.createdTimestamp = new Date().toString();
this.lastInteraction = new Date();
// npm module: username, url: https://www.npmjs.com/package/username
this.createdBy = require('username').sync();
this.cardBuilder(type);
this.updateMetadata();
} Also, the |
…ed. Tests that will not currently passed are commented out. Card, canvas, and extended card classes are simplified.
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.
Please fix the two concerns outlined for test/card-test.js
on lines 20 and 99-103. I will approve this PR when a fix has been added.
test/card-test.js
Outdated
path: electron, | ||
this.jsdom = require('jsdom-global')() | ||
global.$ = global.jQuery = require('jquery'); | ||
app = new Application({ path: electron, |
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.
For line 20, there isn't really a good reason to shorten the path:
field onto the same line as the new Application
declaration; this change adds clutter.
test/card-test.js
Outdated
"\n\t(lastInteraction should update after Card#updateMetadata()" + | ||
" method is evoked)"; | ||
"\n\t(lastInteraction should update after Card#updateMetadata()" + | ||
" method is evoked)"; |
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.
For lines 102-103, it is unclear why these lines are being shortened up to the same vertical alignment as line 101, which represents the starting line for the run-on content that is on lines 102-103. Especially in light of the allowance for the original style on lines 99-100 remaining the same. This change creates a discontinuity in styles.
Updated:
Card
class now builds its contents, including:id
.TextEditor
andCodeEditor
classes now build their contents, including:SketchPad
class now build their contents, including:Raphael
sketchpad is appended to card faces.Canvas
class now has remove card functionality.Card Tests
checks:TextEditor
,SketchPad
, andCodeEditor
contain contents listed above.Canvas Tests
now checks that the correct number of cards is accounted for by the canvas when cards are added and/or removed.