Skip to content

Commit

Permalink
chore: add basic Telegram tests (#108)
Browse files Browse the repository at this point in the history
* chore: add basic Telegram tests

* chore: add /help tests

* chore: add add_mute tests

* chore: add delete_mute tests

* chore: add list_mutes tests

* chore: add list_proposals tests

* chore: add params tests

* chore: add tally tests and updated command

* chore: add events tests

* chore: removed unused
  • Loading branch information
freak12techno authored Dec 2, 2024
1 parent 6dea047 commit 800f6d3
Show file tree
Hide file tree
Showing 55 changed files with 3,683 additions and 100 deletions.
4 changes: 4 additions & 0 deletions assets/responses/add-mutes-no-params.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Created mute with the following params:
<strong>Chain:</strong> all chains
<strong>Proposal ID:</strong> all proposals
<strong>Expires: </strong>Sun, 01 Dec 2024 16:56:01 GMT
4 changes: 4 additions & 0 deletions assets/responses/add-mutes-params.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Created mute with the following params:
<strong>Chain:</strong> chain
<strong>Proposal ID:</strong> proposal
<strong>Expires: </strong>Sun, 01 Dec 2024 16:56:01 GMT
3 changes: 3 additions & 0 deletions assets/responses/delete-mute-no-params.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Deleted mute with the following params:
<strong>Chain:</strong> all chains
<strong>Proposal ID:</strong> all proposals
3 changes: 3 additions & 0 deletions assets/responses/delete-mute-params.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Deleted mute with the following params:
<strong>Chain:</strong> chain
<strong>Proposal ID:</strong> proposal
1 change: 1 addition & 0 deletions assets/responses/list-mutes-empty.html
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
No active mutes.
7 changes: 7 additions & 0 deletions assets/responses/list-mutes.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<strong>Chain:</strong> chain
<strong>Proposal ID:</strong> proposal
<strong>Expires: </strong>Sun, 01 Dec 2024 16:56:01 GMT

<strong>Chain:</strong> all chains
<strong>Proposal ID:</strong> all proposals
<strong>Expires: </strong>Sun, 01 Dec 2024 16:56:01 GMT
7 changes: 7 additions & 0 deletions assets/responses/list-proposals.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<strong>chain1</strong>
❌ Error querying for proposals: proposals fetch error
<strong>FancyChainName</strong>
Proposal #proposal1: proposal1title (voting ends in 1 day 17 hours 17 minutes)
❌ Wallet wallet1 - error querying: vote fetch error
🔴 Wallet wallet2 - not voted
✅ Wallet FancyWalletAlias - voted: Yes
6 changes: 6 additions & 0 deletions assets/responses/params.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<strong>Params of chain FancyChainName:</strong>
percentParam: 70.00%
durationParam: 1 hour
boolParam: No
boolParamSecond: Yes
amountsParam: 100 denom
9 changes: 9 additions & 0 deletions assets/responses/tally.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<strong>Proposals on chain FancyChainName:</strong>

Proposal #proposal: title
Ends in: 1 day 17 hours 17 minutes
- Not voted: 40.00%
- Voted: 60.00%
- Voted "Yes": 16.67%
- Voted "No": 33.33%
- Voted "No with veto": 50.00%
4 changes: 4 additions & 0 deletions assets/responses/telegram-generic-error.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
❌ There was an error when processing proposals on chain:
<strong>Error text: </strong>>query error

Sent by <a href='https://github.com/QuokkaStake/cosmos-proposals-checker'>cosmos-proposals-checker.</a>
7 changes: 7 additions & 0 deletions assets/responses/telegram-not-voted.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
🔴 <strong> Wallet address hasn't voted on proposal proposal on chain </strong>
proposal title

Voting ends at: Tue, 03 Dec 2024 10:13:01 GMT (in 1 day 17 hours 17 minutes)


Sent by <a href='https://github.com/QuokkaStake/cosmos-proposals-checker'>cosmos-proposals-checker.</a>
4 changes: 4 additions & 0 deletions assets/responses/telegram-proposals-query-error.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
❌ There was an error querying proposals on chain.
<strong>Error text: </strong>query error

Sent by <a href='https://github.com/QuokkaStake/cosmos-proposals-checker'>cosmos-proposals-checker.</a>
9 changes: 9 additions & 0 deletions assets/responses/telegram-revoted.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
↔️ <strong>Wallet address has changed its vote on proposal proposal on chain</strong>
proposal title

Vote: Yes
Old vote: No
Voting ends at: Tue, 03 Dec 2024 10:13:01 GMT (in 1 day 17 hours 17 minutes)


Sent by <a href='https://github.com/QuokkaStake/cosmos-proposals-checker'>cosmos-proposals-checker.</a>
5 changes: 5 additions & 0 deletions assets/responses/telegram-vote-query-error.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
❌ There was an error querying proposal on chain
<strong>Proposal ID: </strong>proposal
<strong>Error text: </strong>query error

Sent by <a href='https://github.com/QuokkaStake/cosmos-proposals-checker'>cosmos-proposals-checker.</a>
8 changes: 8 additions & 0 deletions assets/responses/telegram-voted.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<strong>Wallet address has voted on proposal proposal on chain</strong>
proposal title

Vote: Yes
Voting ends at: Tue, 03 Dec 2024 10:13:01 GMT (in 1 day 17 hours 17 minutes)


Sent by <a href='https://github.com/QuokkaStake/cosmos-proposals-checker'>cosmos-proposals-checker.</a>
6 changes: 6 additions & 0 deletions assets/responses/telegram-voting-finished.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
🏁 <strong> Voting on proposal proposal on chain is finished</strong>
proposal title

Voting status: 🙌 Passed

Sent by <a href='https://github.com/QuokkaStake/cosmos-proposals-checker'>cosmos-proposals-checker.</a>
14 changes: 14 additions & 0 deletions assets/telegram-bot-ok.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"ok": true,
"result": {
"id": 123,
"is_bot": true,
"first_name": "TestBot",
"username": "TestBot",
"can_join_groups": true,
"can_read_all_group_messages": false,
"supports_inline_queries": false,
"can_connect_to_business": false,
"has_main_web_app": false
}
}
Loading

0 comments on commit 800f6d3

Please sign in to comment.