Skip to content

Commit

Permalink
✨ (tests): 添加交通银行信用卡消费测试用例 #461
Browse files Browse the repository at this point in the history
新增交通银行信用卡消费测试数据,更新正则表达式以匹配新的交易附言格式。
  • Loading branch information
AnkioTomas committed Dec 18, 2024
1 parent 1d597bd commit 0734296
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@ const TITLE = ['交易提醒'];
// 正则表达式和处理函数的映射关系
const rules = [
[
// 交易卡号:7355\n交易时间:2024年10月23日 12:05\n交易类型:消费\n交易金额:¥47.00\n交易附言:点击查看详情
//交易卡号:9354\n交易时间:2024年11月29日 11:03\n交易类型:消费\n交易金额:¥10.00\n交易附言:点击查看详情>>>
/交易卡号:(\d+)\n交易时间:(.*?)\n交易类型:(.*?)\n交易金额:¥(\d+.\d{2})\n交易附言:点击查看详情>>>/,
/交易卡号:(\d+)\n交易时间:(.*?)\n交易类型:(.*?)\n交易金额:¥(\d+.\d{2})\n交易附言:点击查看详情/,
(match,t,item) => {
let [,number,time,matchType,money] = match;
let matchTypeName = '';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,17 @@ test('交通银行信用卡支出', () =>
"time": formatDate('2024年11月29日 11:03', 'Y年M月D日 h:i'),
"channel": '微信[交通银行信用卡买单吧-支出]',
},
{
"type": "Expend",
"money": 47,
"fee": 0,
"shopName": '',
"shopItem": '消费',
"accountNameFrom": '交通银行信用卡(7355)',
"accountNameTo": '',
"currency": 'CNY',
"time": formatDate('2024年10月23日 12:05', 'Y年M月D日 h:i'),
"channel": '微信[交通银行信用卡买单吧-支出]',
},
]));

Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"mMap": {
"tableName": "AppMessage",
"description": "交易卡号:7355\n交易时间:2024年10月23日 12:05\n交易类型:消费\n交易金额:¥47.00\n交易附言:点击查看详情",
"source": "交通银行信用卡买单吧",
"t": 1729656316832,
"arg": "msgId",
"type": 5,
"appId": "",
"msgId": 10127940,
"title": "交易提醒"
}
}

0 comments on commit 0734296

Please sign in to comment.