Skip to content

Commit

Permalink
#9 added spec for quick styler
Browse files Browse the repository at this point in the history
  • Loading branch information
abbr committed Oct 15, 2017
1 parent 28f798b commit 1646f89
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 1 deletion.
13 changes: 13 additions & 0 deletions test/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
to debug test, run

```sh
./node_modules/.bin/karma start --no-single-run --browsers Chrome
```
then click debug and press F12 to launch Chrome Developer Tools

to run test in ci mode, run

```sh
npm run test:watch
```
Tests runs in headless Chromium downloaded by Puppeteer.
18 changes: 18 additions & 0 deletions test/components/styler/quickTest.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import { appWrapper } from 'helpers/fullRenderHelper'

describe('styler > quick', () => {
it('should change style when hover mouse over palette #1', () => {
let otSlide = $('.sp-operating-table .sp-ot-slide')
const originalStyle = otSlide.css('background').slice(0)
let palette1Dom = $(
'.sp-navbar-style #sp-quick-styler > .sp-palette[title="palette 1"]'
)
let palette1 = appWrapper.find(
'.sp-navbar-style #sp-quick-styler > .sp-palette[title="palette 1"]'
)
palette1.simulate('mouseover')
expect(otSlide.css('background')).to.equal(palette1Dom.css('background'))
palette1.simulate('mouseleave')
expect(otSlide.css('background')).to.equal(originalStyle)
})
})
2 changes: 1 addition & 1 deletion test/components/widgets/controls/rotateTest.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { appWrapper } from 'helpers/fullRenderHelper'

describe('widgets > controls > rotate', () => {
it('should rotate 90° cw along z axis', () => {
it('should rotate about 90° cw along z axis', () => {
let domComponent = $('.sp-operating-table .sp-ot-slide .sp-component:first')
expect(
domComponent.find('.sp-edit-ctrls .rotate-z span:first').text()
Expand Down

0 comments on commit 1646f89

Please sign in to comment.