ASQ-USI / question-editor-asq

Question editor for ASQ
1 stars 0 forks source link

Drag and drop #7

Closed marco9446 closed 8 years ago

marco9446 commented 8 years ago

Added the possibility to drag and drop an element from the right nav bar into the slide canvas. All the imported element are lazy loaded and injected in the slide area. The drop target is now hard coded to the rood of slide area (paper-element) but it already prepared to work with a customisable target

triglian commented 8 years ago

Tests

When testing an element (unit-test) you should minimally test

  1. Public methods
  2. setting and getting public properties
  3. content nodes (check if content is distributed like you want it to)
  4. render (if sub elements are where they need to be, if dom-if templates work as they should etc.)

When testing a feature normally there's more than a few elements involved. There you need to programmatically perform a user interaction (e.g drag and drop) and check if everything is at it's place. Bear in mind that how an element renders is also important

Check the designer for tests

marco9446 commented 8 years ago

I changed the name of components in order to follow convention and avoid name collision. I did't find a linter for javascript, compatible with polymer and gulp, so i just implemented polylint. The droppable are is now the whole stage and i made some changes in the style to remain as neutral as possible and you have also the ability to create group in the draggable list. I'll make some test after having converted the project to ES6

marco9446 commented 8 years ago

I have decided to abandon the idea of using a custom element to wrap selected item since i haven't found any good reason to proceed in that direction. Right now I just wrap the dynamically created elements in a DIV

triglian commented 8 years ago

There should be a command that runs the test when you do npm test