Skip to content

Commit 9a9abcf

Browse files
authored
Add tests
1 parent 1279457 commit 9a9abcf

24 files changed

+4220
-63
lines changed

.circleci/config.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
version: 2.0
2+
jobs:
3+
build:
4+
docker:
5+
- image: circleci/node:10.16-browsers
6+
steps:
7+
- checkout
8+
9+
- restore_cache:
10+
keys:
11+
- v1-dependencies-{{ checksum "package.json" }}
12+
- v1-dependencies-
13+
14+
- run: npm install
15+
16+
- save_cache:
17+
paths:
18+
- node_modules
19+
key: v1-dependencies-{{ checksum "package.json" }}
20+
21+
- run: npm run build:umd
22+
23+
- run: npm run test:compat
24+
- run: npm run test
25+
26+
- store_test_results:
27+
path: /tmp/test-results

.editorconfig

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,6 @@ insert_final_newline = true
1010

1111
[*.md]
1212
trim_trailing_whitespace = false
13+
14+
[*.yml]
15+
indent_style = space

.testcaferc.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"speed": 0.4,
3+
"reporter": {
4+
"name": "xunit",
5+
"output": "/tmp/test-results/res.xml"
6+
}
7+
}

README.md

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Sortable   [![DeepScan grade](https://deepscan.io/api/teams/3901/projects/5666/branches/43977/badge/grade.svg)](https://deepscan.io/dashboard#view=project&tid=3901&pid=5666&bid=43977) [![](https://data.jsdelivr.com/v1/package/npm/sortablejs/badge)](https://www.jsdelivr.com/package/npm/sortablejs) [![npm](https://img.shields.io/npm/v/sortablejs.svg)](https://www.npmjs.com/package/sortablejs)
1+
# Sortable   [![CircleCI](https://circleci.com/gh/SortableJS/Sortable.svg?style=svg)](https://circleci.com/gh/SortableJS/Sortable) [![DeepScan grade](https://deepscan.io/api/teams/3901/projects/5666/branches/43977/badge/grade.svg)](https://deepscan.io/dashboard#view=project&tid=3901&pid=5666&bid=43977) [![](https://data.jsdelivr.com/v1/package/npm/sortablejs/badge)](https://www.jsdelivr.com/package/npm/sortablejs) [![npm](https://img.shields.io/npm/v/sortablejs.svg)](https://www.npmjs.com/package/sortablejs)
22

33
Sortable is a JavaScript library for reorderable drag-and-drop lists.
44

@@ -284,7 +284,7 @@ Whether or not the delay should be applied only if the user is using touch (eg.
284284

285285

286286
#### `swapThreshold` option
287-
Percentage of the target that the swap zone will take up, as a float between `0` and `1`. This option has nothing to do with the `swap` option.
287+
Percentage of the target that the swap zone will take up, as a float between `0` and `1`.
288288

289289
[Read more](https://github.com/SortableJS/Sortable/wiki/Swap-Thresholds-and-Direction#swap-threshold)
290290

@@ -295,7 +295,7 @@ Demo: http://sortablejs.github.io/Sortable#thresholds
295295

296296

297297
#### `invertSwap` option
298-
Set to `true` to set the swap zone to the sides of the target, for the effect of sorting "in between" items. This option has nothing to do with the `swap` option.
298+
Set to `true` to set the swap zone to the sides of the target, for the effect of sorting "in between" items.
299299

300300
[Read more](https://github.com/SortableJS/Sortable/wiki/Swap-Thresholds-and-Direction#forcing-inverted-swap-zone)
301301

@@ -306,7 +306,7 @@ Demo: http://sortablejs.github.io/Sortable#thresholds
306306

307307

308308
#### `invertedSwapThreshold` option
309-
Percentage of the target that the inverted swap zone will take up, as a float between `0` and `1`. If not given, will default to `swapThreshold`. This option has nothing to do with the `swap` option.
309+
Percentage of the target that the inverted swap zone will take up, as a float between `0` and `1`. If not given, will default to `swapThreshold`.
310310

311311
[Read more](https://github.com/SortableJS/Sortable/wiki/Swap-Thresholds-and-Direction#dealing-with-swap-glitching)
312312

@@ -694,7 +694,14 @@ The clone element.
694694
---
695695

696696

697-
##### Sortable.mount(plugin:`...SortablePlugin|...SortablePlugin[]`)
697+
##### Sortable.get(element:`HTMLElement`):`Sortable`
698+
Get the Sortable instance on an element.
699+
700+
701+
---
702+
703+
704+
##### Sortable.mount(plugin:`...SortablePlugin|SortablePlugin[]`)
698705
Mounts a plugin to Sortable.
699706

700707

0 commit comments

Comments
 (0)