File tree Expand file tree Collapse file tree 6 files changed +19
-18
lines changed
apps/browser-extension-wallet/src/views/browser-view/features/sign-message
common/src/ui/components/Form/TextArea Expand file tree Collapse file tree 6 files changed +19
-18
lines changed Original file line number Diff line number Diff line change @@ -146,7 +146,7 @@ export const SignMessageDrawer: React.FC = () => {
146
146
placeholder = { t ( 'core.signMessage.messagePlaceholder' ) }
147
147
value = { message }
148
148
onChange = { ( e ) => setMessage ( e . target . value ) }
149
- dataTestId = "sign-message-input "
149
+ dataTestId = "sign-message"
150
150
rows = { 4 }
151
151
className = { styles . customTextArea }
152
152
/>
Original file line number Diff line number Diff line change @@ -58,7 +58,10 @@ export const TextArea = ({
58
58
return (
59
59
< div className = { cn ( styles . wrapper , wrapperClassName ) } >
60
60
{ label && (
61
- < span className = { cn ( 'text-area-label' , styles . label , { [ styles . focused ] : isFocused || localVal } ) } >
61
+ < span
62
+ className = { cn ( 'text-area-label' , styles . label , { [ styles . focused ] : isFocused || localVal } ) }
63
+ data-testid = { dataTestId ? `${ dataTestId } -label` : 'text-area-label' }
64
+ >
62
65
{ label }
63
66
</ span >
64
67
) }
@@ -72,7 +75,7 @@ export const TextArea = ({
72
75
}
73
76
} }
74
77
onChange = { onValChange }
75
- data-testid = { dataTestId }
78
+ data-testid = { dataTestId ? ` ${ dataTestId } -input` : 'text-area-input' }
76
79
value = { localVal }
77
80
autoSize
78
81
rows = { props . rows ?? 1 }
Original file line number Diff line number Diff line change @@ -7,12 +7,12 @@ import { act } from 'react-dom/test-utils';
7
7
describe ( 'TextArea' , ( ) => {
8
8
test ( 'initial value is an empty string' , ( ) => {
9
9
const { queryByTestId } = render ( < TextArea dataTestId = "text-area-test" /> ) ;
10
- expect ( queryByTestId ( 'text-area-test' ) ) . toHaveValue ( '' ) ;
10
+ expect ( queryByTestId ( 'text-area-test-input ' ) ) . toHaveValue ( '' ) ;
11
11
} ) ;
12
12
test ( 'on input change value is updated and onChange function prop is called' , ( ) => {
13
13
const onChange = jest . fn ( ) ;
14
14
const { queryByTestId } = render ( < TextArea dataTestId = "text-area-test" onChange = { onChange } /> ) ;
15
- const area = queryByTestId ( 'text-area-test' ) ;
15
+ const area = queryByTestId ( 'text-area-test-input ' ) ;
16
16
expect ( area ) . toHaveValue ( '' ) ;
17
17
act ( ( ) => {
18
18
area && fireEvent . change ( area , { target : { value : 'new value' } } ) ;
@@ -24,7 +24,7 @@ describe('TextArea', () => {
24
24
const onBlur = jest . fn ( ) ;
25
25
const { queryByTestId } = render ( < TextArea dataTestId = "text-area-test" onBlur = { onBlur } /> ) ;
26
26
await waitFor ( ( ) => {
27
- const area = queryByTestId ( 'text-area-test' ) ;
27
+ const area = queryByTestId ( 'text-area-test-input ' ) ;
28
28
area && fireEvent . blur ( area ) ;
29
29
} ) ;
30
30
expect ( onBlur ) . toHaveBeenCalled ( ) ;
Original file line number Diff line number Diff line change @@ -7,11 +7,10 @@ import clipboard from 'clipboardy';
7
7
import testContext from '../../utils/testContext' ;
8
8
9
9
class SecureYourPaperWalletPage extends CommonOnboardingElements {
10
- // TODO: update selectors when new lace-ui-toolkit package is released
11
- private PGP_KEY_NAME_INPUT = '[data-testid="pgp-public-key-reference"]' ;
12
- private PGP_KEY_NAME_INPUT_LABEL = '//form//label' ;
13
- private YOUR_PUBLIC_PGP_KEY_BLOCK_INPUT = '[data-testid="pgp-public-key-block"]' ;
14
- private YOUR_PUBLIC_PGP_KEY_BLOCK_INPUT_LABEL = '//span[contains(@class, "text-area-label")]' ;
10
+ private PGP_KEY_NAME_INPUT = '[data-testid="pgp-public-key-reference-input"]' ;
11
+ private PGP_KEY_NAME_INPUT_LABEL = '[data-testid="pgp-public-key-reference-label"]' ;
12
+ private YOUR_PUBLIC_PGP_KEY_BLOCK_INPUT = '[data-testid="pgp-public-key-block-input"]' ;
13
+ private YOUR_PUBLIC_PGP_KEY_BLOCK_INPUT_LABEL = '[data-testid="pgp-public-key-block-label"]' ;
15
14
private FINGERPRINT_ICON = '[data-testid="fingerprint-icon"]' ;
16
15
private FINGERPRINT_TEXT = '[data-testid="fingerprint-text"]' ;
17
16
private VALIDATION_ERROR = '[data-testid="validation-error"]' ;
Original file line number Diff line number Diff line change @@ -5,10 +5,10 @@ import type { ChainablePromiseElement } from 'webdriverio';
5
5
class MessageSigningAllDoneDrawer extends CommonDrawerElements {
6
6
private IMAGE = '[data-testid="result-message-img"]' ;
7
7
private TITLE = '[data-testid="result-message-title"]' ;
8
- private SIGNATURE = '[data-testid="sign-message-signature"]' ;
8
+ private SIGNATURE = '[data-testid="sign-message-signature-input "]' ;
9
9
private SIGNATURE_LABEL = '[data-testid="result-message-signature-label"]' ;
10
10
private SIGNATURE_COPY_TO_CLIPBOARD_BUTTON = '[data-testid="signature-copy-to-clipboard-button"]' ;
11
- private KEY = '[data-testid="sign-message-key"]' ;
11
+ private KEY = '[data-testid="sign-message-key-input "]' ;
12
12
private KEY_LABEL = '[data-testid="result-message-key-label"]' ;
13
13
private KEY_COPY_TO_CLIPBOARD_BUTTON = '[data-testid="public-key-copy-to-clipboard-button"]' ;
14
14
private SIGN_ANOTHER_MESSAGE_BUTTON = '[data-testid="sign-another-message-button"]' ;
Original file line number Diff line number Diff line change @@ -3,11 +3,10 @@ import CommonDrawerElements from '../CommonDrawerElements';
3
3
import type { ChainablePromiseElement } from 'webdriverio' ;
4
4
5
5
class SecureYourPaperWalletDrawer extends CommonDrawerElements {
6
- // TODO: update selectors when new lace-ui-toolkit package is released
7
- private PGP_KEY_NAME_INPUT = '[data-testid="pgp-public-key-reference"]' ;
8
- private PGP_KEY_NAME_INPUT_LABEL = '//form//label' ;
9
- private YOUR_PUBLIC_PGP_KEY_BLOCK_INPUT = '[data-testid="pgp-public-key-block"]' ;
10
- private YOUR_PUBLIC_PGP_KEY_BLOCK_INPUT_LABEL = '//span[contains(@class, "text-area-label")]' ;
6
+ private PGP_KEY_NAME_INPUT = '[data-testid="pgp-public-key-reference-input"]' ;
7
+ private PGP_KEY_NAME_INPUT_LABEL = '[data-testid="pgp-public-key-reference-label"]' ;
8
+ private YOUR_PUBLIC_PGP_KEY_BLOCK_INPUT = '[data-testid="pgp-public-key-block-input"]' ;
9
+ private YOUR_PUBLIC_PGP_KEY_BLOCK_INPUT_LABEL = '[data-testid="pgp-public-key-block-label"]' ;
11
10
private NEXT_BUTTON = '[data-testid="next-button"]' ;
12
11
13
12
get pgpKeyNameInput ( ) : ChainablePromiseElement < WebdriverIO . Element > {
You can’t perform that action at this time.
0 commit comments