Polish routing rules UI and normalize pasted values
This commit is contained in:
@@ -32,7 +32,9 @@ test('rule editor add latency stays constant and dirty exits are guarded', () =>
|
||||
assert.match(routing, /client-deletable-row/);
|
||||
assert.match(routing, /className="client-delete-strike"[\s\S]*onAnimationEnd/);
|
||||
assert.doesNotMatch(routing, /client-rule-delete-cross/);
|
||||
assert.match(routing, /className="client-row-delete"/);
|
||||
assert.match(routing, /className="client-row-delete"[\s\S]*client-row-delete-lid/);
|
||||
assert.match(styles, /\.client-row-delete-lid \{[\s\S]*transition: transform/);
|
||||
assert.match(styles, /\.client-row-delete:hover:not\(:disabled\) \.client-row-delete-lid,[\s\S]*translateY\(-2px\) rotate\(-8deg\)/);
|
||||
assert.match(styles, /\.client-deletable-row\.is-removing > \.client-delete-strike[\s\S]*client-delete-strike/);
|
||||
assert.match(styles, /\.client-delete-strike \{[\s\S]*z-index: 100[\s\S]*background: transparent/);
|
||||
assert.match(styles, /\.client-deletable-row\.is-removing > :not\(\.client-delete-strike\)[\s\S]*z-index: 0/);
|
||||
@@ -96,7 +98,7 @@ test('copy feedback, drawers and Gateway access actions expose complete semantic
|
||||
assert.doesNotMatch(component, /client-access-tabs|role="tab"|role="tabpanel"/);
|
||||
assert.match(styles, /\.client-drawer-close \{[\s\S]*width: 44px;[\s\S]*height: 44px/);
|
||||
assert.match(styles, /@media \(max-width: 560px\)[\s\S]*\.client-copy-button \{[\s\S]*min-height: 44px/);
|
||||
assert.match(styles, /@media \(max-width: 560px\)[\s\S]*\.client-rule-handle,[\s\S]*\.client-local-rule-enabled,[\s\S]*\.client-row-delete \{[\s\S]*width: 44px;[\s\S]*height: 44px/);
|
||||
assert.match(styles, /@media \(max-width: 560px\)[\s\S]*\.client-rule-handle,[\s\S]*\.client-local-rule-enabled-wrap,[\s\S]*\.client-row-delete \{[\s\S]*width: 44px;[\s\S]*height: 44px/);
|
||||
});
|
||||
|
||||
test('ordered rules use one accessible drag handle and a compact icon route control', () => {
|
||||
@@ -114,6 +116,14 @@ test('ordered rules use one accessible drag handle and a compact icon route cont
|
||||
assert.doesNotMatch(routing, /client-rule-outbound" role="group"/);
|
||||
assert.match(routing, /className=\{`client-local-rules-list\$\{draftRules\.length > 1 \? ' has-order-flow' : ''\}`\}[\s\S]*aria-label="Правила применяются сверху вниз"/);
|
||||
assert.match(routing, /className="client-rule-status-dot"/);
|
||||
assert.match(routing, /role="switch"[\s\S]*aria-checked=\{rule\.enabled\}[\s\S]*client-rule-switch-track[\s\S]*client-rule-switch-thumb/);
|
||||
assert.match(routing, /Отключить правило'[\s\S]*Включить правило'[\s\S]*<Tooltip>/);
|
||||
assert.match(routing, /data-route=\{rule\.outbound\}/);
|
||||
assert.match(styles, /\.client-local-rule\[data-route='direct'\] \{[\s\S]*--client-rule-route-color/);
|
||||
assert.match(styles, /\.client-local-rule::after \{[\s\S]*background: var\(--client-rule-route-color\)/);
|
||||
assert.match(styles, /\.client-local-rule\.is-active \.client-rule-status-dot \{[\s\S]*background: currentColor/);
|
||||
assert.match(styles, /\.client-local-rule\.is-unsaved \.client-rule-status-dot \{[\s\S]*border-radius: 1px[\s\S]*rotate\(45deg\)/);
|
||||
assert.match(styles, /\.client-local-rule\.is-pending \.client-rule-status-dot \{[\s\S]*border: 1\.5px dashed/);
|
||||
assert.doesNotMatch(routing, />\s*[↑↓]\s*</);
|
||||
assert.match(styles, /\.client-rule-handle \{[\s\S]*width: 44px;[\s\S]*height: 44px;[\s\S]*touch-action: none/);
|
||||
assert.match(styles, /\.client-rule-outbound \{[\s\S]*width: 34px/);
|
||||
@@ -121,3 +131,12 @@ test('ordered rules use one accessible drag handle and a compact icon route cont
|
||||
assert.match(styles, /\.client-local-rules-list\.has-order-flow::before[\s\S]*linear-gradient\(to bottom/);
|
||||
assert.match(styles, /\.client-local-rule \+ \.client-local-rule::before[\s\S]*linear-gradient\(90deg/);
|
||||
});
|
||||
|
||||
test('rule values normalize on paste and help stays collapsed above the list', () => {
|
||||
assert.match(routing, /normalizeRouteRules\(\[\{ \.\.\.rule, value \}\], \{ strict: true \}\)/);
|
||||
assert.match(routing, /onPaste=\{\(event\) => \{[\s\S]*event\.preventDefault\(\)[\s\S]*normalizeDraftRuleValue\(rule, event\.clipboardData\.getData\('text'\)\)/);
|
||||
assert.match(routing, /onBlur=\{\(\) => feature\.change\(index, 'value', normalizeDraftRuleValue\(rule, rule\.value\)\)\}/);
|
||||
assert.match(routing, /<details className="client-local-rules-help">[\s\S]*<summary>[\s\S]*Как работают правила[\s\S]*<form id="client-local-rules-form"/);
|
||||
assert.doesNotMatch(routing, /client-local-rules-note/);
|
||||
assert.match(styles, /\.client-local-rules-help > div \{[\s\S]*background: color-mix/);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user