mirror of
https://github.com/pezkuwichain/pezkuwi-apps.git
synced 2026-10-30 21:59:48 +00:00
Accounts, Contacts and Sidebar specs: follow the current table layout, run them
The three suites were skipped since the table rework. What changed under them: - An account or contact spans three rows (main, total balance, details), marked from isFirst; the helpers paired rows by two and filtered on a row class the rows no longer carry. A collapsed details row is hidden, so rows are read including hidden ones. - Accounts render one table per account group; the page object reads the rows of every group table in order, and the sorting fixture keeps its three accounts in one group, since sorting applies within a group. - The expand toggle is the row's expand column, not a row-toggle element. - useAccountInfo reads ownership from the keyring context, which the test page did not provide, so saving a name did nothing; the page now renders the real KeyringCtxRoot. The mock api gains consts.system.ss58Prefix. - Badge popups (react-tooltip v6) render only while hovered; the specs hover the badge first. The multisig badge needs the isMultisig flag. - Addresses are shown in full and shortened by css; the fixtures with shortened addresses are gone. - The total balance, transferable and locked cards are always shown, as placeholders without accounts; the specs check that instead of their absence. - Checks that needed matchers the runner lacks (not.toHaveLength, toHaveProperty, toThrow with a contained message) are written against the DOM directly.
This commit is contained in:
1 parent
61c681567d
commit
3767c819e3
11 files changed
+136
-107
No files matched your search
@@ -24,6 +24,16 @@ export function assertHasClass (node: Node | null, className: string): void {
|
||||
assert.ok(classList.contains(className), `Expected class "${className}" on ${describeElement(node)}`);
|
||||
}
|
||||
|
||||
/** As not.toHaveClass: the element is there, without the class */
|
||||
export function assertNotHasClass (node: Node | null, className: string): void {
|
||||
assert.ok(node, `Expected an element without class "${className}", found none`);
|
||||
|
||||
const classList = (node as Partial<Element>).classList;
|
||||
|
||||
assert.ok(classList, `Expected an element without class "${className}", found ${describeElement(node)}`);
|
||||
assert.ok(!classList.contains(className), `Expected no class "${className}" on ${describeElement(node)}`);
|
||||
}
|
||||
|
||||
/** As toHaveTextContent: the whitespace-normalized text contains the string, or matches the pattern */
|
||||
export function assertTextContent (element: Node | null, expected: string | RegExp): void {
|
||||
assert.ok(element, `Expected an element with text ${String(expected)}, found none`);
|
||||
|
||||
Reference in new issue
Block a user