-
Notifications
You must be signed in to change notification settings - Fork 79
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
storybook: test_mintTokensIntroPages added #16362
Open
anastasiyaig
wants to merge
1
commit into
master
Choose a base branch
from
storybook-test-for-tokens-page
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+138
−0
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
116 changes: 116 additions & 0 deletions
116
storybook/qmlTests/tests/tst_MintTokensSettingsPanel.qml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,116 @@ | ||
import QtQuick 2.15 | ||
import QtQuick.Controls 2.15 | ||
|
||
import QtTest 1.15 | ||
|
||
import StatusQ 0.1 | ||
|
||
import SortFilterProxyModel 0.2 | ||
import AppLayouts.Communities.panels 1.0 | ||
|
||
import Models 1.0 | ||
|
||
import StatusQ.Core.Utils 0.1 as StatusQUtils | ||
|
||
Item { | ||
|
||
id: root | ||
width: 600 | ||
height: 800 | ||
|
||
Component { | ||
id: componentUnderTest | ||
|
||
MintTokensSettingsPanel { | ||
communityId: "88" | ||
communityName: "SuperRare" | ||
communityLogo: ModelsData.icons.superRare | ||
communityColor: "Light pink" | ||
isOwner: true | ||
isTokenMasterOwner: true | ||
isAdmin: true | ||
referenceAssetsBySymbolModel: ListModel { | ||
ListElement { | ||
name: "eth" | ||
symbol: "ETH" | ||
} | ||
ListElement { | ||
name: "dai" | ||
symbol: "DAI" | ||
} | ||
ListElement { | ||
name: "snt" | ||
symbol: "SNT" | ||
} | ||
} | ||
|
||
anchors.fill: parent | ||
} | ||
} | ||
|
||
property MintTokensSettingsPanel mintTokensSettingsPanel | ||
|
||
TestCase { | ||
name: "MintTokensSettingsPanel" | ||
when: windowShown | ||
|
||
function init() { | ||
mintTokensSettingsPanel = createTemporaryObject(componentUnderTest, | ||
root) | ||
} | ||
|
||
function htmlToPlainText(html) { | ||
return html.replace(/<[^>]+>/g, "") | ||
} | ||
|
||
function test_mintTokensIntroPages() { | ||
|
||
const introPanel = findChild(mintTokensSettingsPanel, "introPanel") | ||
const infoBoxPanel = findChild(mintTokensSettingsPanel, | ||
"infoBoxPanel") | ||
const infoBoxPanelButton = findChild(mintTokensSettingsPanel, | ||
"statusInfoBoxPanelButton") | ||
|
||
waitForRendering(mintTokensSettingsPanel) | ||
compare(introPanel.title, "Community tokens") | ||
compare(introPanel.subtitle, | ||
"You can mint custom tokens and import tokens for your community") | ||
compare(JSON.stringify(introPanel.checkersModel), JSON.stringify( | ||
["Create remotely destructible soulbound tokens for admin permissions", "Reward individual members with custom tokens for their contribution", "Mint tokens for use with community and channel permissions"])) | ||
|
||
compare(infoBoxPanel.title, "Get started") | ||
compare(infoBoxPanel.text, | ||
"In order to Mint, Import and Airdrop community tokens, you first need to mint your Owner token which will give you permissions to access the token management features for your community.") | ||
compare(infoBoxPanel.buttonText, "Mint Owner token") | ||
compare(infoBoxPanel.buttonVisible, true) | ||
|
||
mouseClick(infoBoxPanelButton) | ||
|
||
waitForRendering(mintTokensSettingsPanel) | ||
waitForItemPolished(mintTokensSettingsPanel) | ||
|
||
tryCompare(mintTokensSettingsPanel.currentItem, "objectName", | ||
"ownerTokenPage") | ||
|
||
var settingsPage = findChild(mintTokensSettingsPanel.currentItem, | ||
"welcomeView") | ||
|
||
|
||
compare(htmlToPlainText(((findChild(settingsPage, | ||
"introPanelText")).text).replace(/’/g, "'")), | ||
"Your Owner token will give you permissions to access the token management features for your community. This token is very important - only one will ever exist, and if this token gets lost then access to the permissions it enables for your community will be lost forever as well. | ||
Minting your Owner token also automatically mints your community's TokenMaster token. You can airdrop your community's TokenMaster token to anybody you wish to grant both Admin permissions and permission to access your community's token management functions to. | ||
Only the hodler of the Owner token can airdrop TokenMaster tokens. TokenMaster tokens are soulbound (meaning they can't be transferred), and you (the hodler of the Owner token) can remotely destruct a TokenMaster token at any time, to revoke TokenMaster permissions from any individual.") | ||
Comment on lines
+99
to
+103
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do we need to put the full text here? Maybe we could just check if it begins with the proper phrase? Having full string here doesn't help probably. We stil have not guarantee it's displayed properly at least. Btw. I would add check if the component is visible. |
||
compare(JSON.stringify((findChild( | ||
settingsPage, | ||
"ownerChecklist")).checkersModel), | ||
JSON.stringify( | ||
["Only 1 will ever exist", "Hodler is the owner of the Community", "Ability to airdrop / destroy TokenMaster token", "Ability to mint and airdrop Community tokens"])) | ||
compare(JSON.stringify((findChild( | ||
settingsPage, | ||
"masterChecklist")).checkersModel), | ||
JSON.stringify( | ||
["Unlimited supply", "Grants full Community admin rights", "Ability to mint and airdrop Community tokens", "Non-transferrable", "Remotely destructible by the Owner token hodler"])) | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.