Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
leizi929
Sortable
提交
652098ad
S
Sortable
项目概览
leizi929
/
Sortable
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
S
Sortable
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
652098ad
编写于
2月 18, 2016
作者:
R
RubaXa
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
+ QUnit
上级
54ec83bb
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
37 addition
and
5 deletion
+37
-5
tests/index.html
tests/index.html
+13
-1
tests/sortable.tests.js
tests/sortable.tests.js
+5
-4
tests/src/qunit.ext.js
tests/src/qunit.ext.js
+13
-0
tests/src/simulate.js
tests/src/simulate.js
+6
-0
未找到文件。
tests/index.html
浏览文件 @
652098ad
...
@@ -8,7 +8,6 @@
...
@@ -8,7 +8,6 @@
<title>
Sortable :: Tests
</title>
<title>
Sortable :: Tests
</title>
</head>
</head>
<body>
<body>
<div
id=
"canvas"
>
<div
id=
"canvas"
>
<ul
id=
"simple"
>
<ul
id=
"simple"
>
<li>
item 1
</li>
<li>
item 1
</li>
...
@@ -17,11 +16,24 @@
...
@@ -17,11 +16,24 @@
</ul>
</ul>
</div>
</div>
<div
id=
"qunit"
></div>
<div
id=
"qunit-fixture"
></div>
<link
rel=
"stylesheet"
href=
"//code.jquery.com/qunit/qunit-1.21.0.css"
/>
<script
src=
"//code.jquery.com/qunit/qunit-1.21.0.js"
></script>
<script
src=
"./src/raf.js"
></script>
<script
src=
"./src/raf.js"
></script>
<script
src=
"./src/simulate.js"
></script>
<script
src=
"./src/simulate.js"
></script>
<script
src=
"./src/qunit.ext.js"
></script>
<script
src=
"../Sortable.js"
></script>
<script
src=
"../Sortable.js"
></script>
<script>
Sortable
.
create
(
simple
);
</script>
<script
src=
"./sortable.tests.js"
></script>
<script
src=
"./sortable.tests.js"
></script>
</body>
</body>
</html>
</html>
tests/sortable.tests.js
浏览文件 @
652098ad
'
use strict
'
;
'
use strict
'
;
Sortable
.
create
(
simple
);
QUnit
.
module
(
'
Sortable
'
);
simulateDrag
(
{
QUnit
.
sortableTest
(
'
simple
'
,
{
from
:
{
from
:
{
el
:
'
#simple
'
,
el
:
'
#simple
'
,
index
:
0
index
:
0
...
@@ -12,6 +12,7 @@ simulateDrag({
...
@@ -12,6 +12,7 @@ simulateDrag({
el
:
'
#simple
'
,
el
:
'
#simple
'
,
index
:
'
last
'
index
:
'
last
'
}
}
},
function
()
{
},
function
(
assert
,
scope
)
{
assert
.
ok
(
scope
.
toList
.
contains
(
scope
.
target
),
'
container
'
);
assert
.
equal
(
scope
.
target
,
scope
.
toList
.
lastElementChild
,
'
position
'
);
});
});
tests/src/qunit.ext.js
0 → 100644
浏览文件 @
652098ad
(
function
()
{
'
use strict
'
;
QUnit
.
sortableTest
=
function
sortableTest
(
name
,
options
,
fn
)
{
QUnit
.
test
(
name
,
function
(
assert
)
{
var
done
=
assert
.
async
();
var
data
=
simulateDrag
(
options
,
function
()
{
fn
(
assert
,
data
,
options
);
done
();
});
});
};
})();
tests/src/simulate.js
浏览文件 @
652098ad
...
@@ -108,6 +108,12 @@
...
@@ -108,6 +108,12 @@
callback
();
callback
();
}
}
});
});
return
{
target
:
fromEl
,
fromList
:
fromEl
.
parentNode
,
toList
:
toEl
.
parentNode
};
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录