Skip to content

Commit 1646f89

Browse files
committed
#9 added spec for quick styler
1 parent 28f798b commit 1646f89

File tree

3 files changed

+32
-1
lines changed

3 files changed

+32
-1
lines changed

test/README.md

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
to debug test, run
2+
3+
```sh
4+
./node_modules/.bin/karma start --no-single-run --browsers Chrome
5+
```
6+
then click debug and press F12 to launch Chrome Developer Tools
7+
8+
to run test in ci mode, run
9+
10+
```sh
11+
npm run test:watch
12+
```
13+
Tests runs in headless Chromium downloaded by Puppeteer.

test/components/styler/quickTest.js

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import { appWrapper } from 'helpers/fullRenderHelper'
2+
3+
describe('styler > quick', () => {
4+
it('should change style when hover mouse over palette #1', () => {
5+
let otSlide = $('.sp-operating-table .sp-ot-slide')
6+
const originalStyle = otSlide.css('background').slice(0)
7+
let palette1Dom = $(
8+
'.sp-navbar-style #sp-quick-styler > .sp-palette[title="palette 1"]'
9+
)
10+
let palette1 = appWrapper.find(
11+
'.sp-navbar-style #sp-quick-styler > .sp-palette[title="palette 1"]'
12+
)
13+
palette1.simulate('mouseover')
14+
expect(otSlide.css('background')).to.equal(palette1Dom.css('background'))
15+
palette1.simulate('mouseleave')
16+
expect(otSlide.css('background')).to.equal(originalStyle)
17+
})
18+
})

test/components/widgets/controls/rotateTest.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { appWrapper } from 'helpers/fullRenderHelper'
22

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

0 commit comments

Comments
 (0)