Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
.Veneno.
wechaty
提交
86cf599a
W
wechaty
项目概览
.Veneno.
/
wechaty
与 Fork 源项目一致
Fork自
wechaty / wechaty
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
W
wechaty
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
86cf599a
编写于
5月 02, 2018
作者:
Huan (李卓桓)
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix unit test to follow new FriendRequest
上级
7e26cf9b
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
15 addition
and
12 deletion
+15
-12
src/puppet-puppeteer/firer.spec.ts
src/puppet-puppeteer/firer.spec.ts
+3
-1
src/puppet-puppeteer/firer.ts
src/puppet-puppeteer/firer.ts
+3
-3
src/puppet-puppeteer/puppeteer-friend-request.spec.ts
src/puppet-puppeteer/puppeteer-friend-request.spec.ts
+8
-7
src/puppet-puppeteer/puppeteer-message.spec.ts
src/puppet-puppeteer/puppeteer-message.spec.ts
+1
-1
未找到文件。
src/puppet-puppeteer/firer.spec.ts
浏览文件 @
86cf599a
...
...
@@ -30,7 +30,9 @@ import * as test from 'blue-tape'
import
{
PuppetPuppeteer
}
from
'
./puppet-puppeteer
'
import
{
Firer
}
from
'
./firer
'
const
mockPuppetPuppeteer
=
{}
as
PuppetPuppeteer
const
mockPuppetPuppeteer
=
{
userSelf
:
()
=>
({}),
}
as
any
as
PuppetPuppeteer
test
(
'
parseFriendConfirm()
'
,
async
t
=>
{
const
contentList
=
[
...
...
src/puppet-puppeteer/firer.ts
浏览文件 @
86cf599a
...
...
@@ -208,16 +208,16 @@ function parseRoomJoin(
async
function
checkRoomJoin
(
this
:
PuppetPuppeteer
,
m
:
PuppeteerMessage
,
m
sg
:
PuppeteerMessage
,
):
Promise
<
boolean
>
{
const
room
=
m
.
room
()
const
room
=
m
sg
.
room
()
if
(
!
room
)
{
log
.
warn
(
'
PuppetPuppeteerFirer
'
,
'
fireRoomJoin() `room` not found
'
)
return
false
}
const
text
=
m
.
text
()
const
text
=
m
sg
.
text
()
let
inviteeList
:
string
[],
inviter
:
string
try
{
...
...
src/puppet-puppeteer/puppeteer-friend-request.spec.ts
浏览文件 @
86cf599a
...
...
@@ -29,10 +29,11 @@ import Wechaty from '../wechaty'
import
{
Puppet
,
}
from
'
../puppet/
'
FriendRequestType
,
}
from
'
../puppet/
'
import
{
PuppetMock
,
}
from
'
../puppet-mock/
'
}
from
'
../puppet-mock/
'
import
PuppeteerContact
from
'
./puppeteer-contact
'
import
PuppeteerMessage
from
'
./puppeteer-message
'
...
...
@@ -55,9 +56,9 @@ test('PuppetPuppeteerFriendRequest.receive smoke testing', async t => {
fr
.
receive
(
rawObj
.
RecommendInfo
)
t
.
true
(
typeof
fr
.
payload
===
'
object
'
,
'
should has info object
'
)
t
.
is
(
fr
.
hello
,
'
我是群聊"Wechaty"的李卓桓.PreAngel
'
,
'
should has right request message
'
)
t
.
true
(
fr
.
contact
instanceof
PuppeteerContact
,
'
should have a Contact instance
'
)
t
.
is
(
fr
.
type
as
any
,
'
receive
'
,
'
should be receive type
'
)
t
.
is
(
fr
.
hello
()
,
'
我是群聊"Wechaty"的李卓桓.PreAngel
'
,
'
should has right request message
'
)
t
.
true
(
fr
.
contact
()
instanceof
PuppeteerContact
,
'
should have a Contact instance
'
)
t
.
is
(
fr
.
type
(),
FriendRequestType
.
RECEIVE
,
'
should be receive type
'
)
})
test
(
'
PuppetPuppeteerFriendRequest.confirm smoke testing
'
,
async
t
=>
{
...
...
@@ -89,6 +90,6 @@ test('PuppetPuppeteerFriendRequest.confirm smoke testing', async t => {
const
contact
=
m
.
from
()
fr
.
confirm
(
contact
||
new
MyContact
(
'
xx
'
))
t
.
true
(
fr
.
contact
instanceof
PuppeteerContact
,
'
should have a Contact instance
'
)
t
.
is
(
fr
.
type
as
any
,
'
confirm
'
,
'
should be confirm type
'
)
t
.
true
(
fr
.
contact
()
instanceof
PuppeteerContact
,
'
should have a Contact instance
'
)
t
.
is
(
fr
.
type
(),
FriendRequestType
.
CONFIRM
,
'
should be confirm type
'
)
})
src/puppet-puppeteer/puppeteer-message.spec.ts
浏览文件 @
86cf599a
...
...
@@ -169,7 +169,7 @@ test('self()', async t => {
t
.
false
(
m
.
self
(),
'
should identify self message false when from a different fromId
'
)
})
test
.
only
(
'
mentioned()
'
,
async
t
=>
{
test
(
'
mentioned()
'
,
async
t
=>
{
/* tslint:disable:max-line-length */
const
rawObj11
=
JSON
.
parse
(
`{"MsgId":"6475340302153501409","FromUserName":"@@9cdc696e490bd76c57e7dd54792dc1408e27d65e312178b1943e88579b7939f4","ToUserName":"@cd7d467d7464e8ff6b0acd29364654f3666df5d04551f6082bfc875f90a6afd2","MsgType":1,"Content":"@4c32c97337cbb325442c304d6a44e374:<br/>@_@","Status":3,"ImgStatus":1,"CreateTime":1489823176,"VoiceLength":0,"PlayLength":0,"FileName":"","FileSize":"","MediaId":"","Url":"","AppMsgType":0,"StatusNotifyCode":0,"StatusNotifyUserName":"","RecommendInfo":{"UserName":"","NickName":"","QQNum":0,"Province":"","City":"","Content":"","Signature":"","Alias":"","Scene":0,"VerifyFlag":0,"AttrStatus":0,"Sex":0,"Ticket":"","OpCode":0},"ForwardFlag":0,"AppInfo":{"AppID":"","Type":0},"HasProductId":0,"Ticket":"","ImgHeight":0,"ImgWidth":0,"SubMsgType":0,"NewMsgId":6475340302153502000,"OriContent":"","MMPeerUserName":"@@9cdc696e490bd76c57e7dd54792dc1408e27d65e312178b1943e88579b7939f4","MMDigest":"22acb030-ff09-11e6-8a73-cff62d9268c5:@_@","MMIsSend":false,"MMIsChatRoom":true,"MMUnread":true,"LocalID":"6475340302153501409","ClientMsgId":"6475340302153501409","MMActualContent":"@_@","MMActualSender":"@4c32c97337cbb325442c304d6a44e374","MMDigestTime":"15:46","MMDisplayTime":1489823176,"MMTime":"15:46"}`
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录