Skip to content

Commit

Permalink
fixing unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
HowardBraham committed Oct 10, 2024
1 parent 963b8f7 commit 8f7eb91
Show file tree
Hide file tree
Showing 6 changed files with 43 additions and 51 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -72,23 +72,19 @@ exports[`Customize Nonce should match snapshot 1`] = `
class="customize-nonce-modal__input"
>
<div
class="MuiFormControl-root MuiTextField-root MuiFormControl-marginDense MuiFormControl-fullWidth"
class="mm-box mm-text-field mm-text-field--size-md mm-text-field--truncate mm-box--padding-right-0 mm-box--padding-left-0 mm-box--display-inline-flex mm-box--align-items-center mm-box--width-full mm-box--background-color-background-default mm-box--rounded-sm mm-box--border-width-1 box--border-style-solid"
min="0"
>
<div
class="MuiInputBase-root MuiInput-root TextField-inputRoot-12 MuiInputBase-fullWidth MuiInput-fullWidth MuiInputBase-formControl MuiInput-formControl MuiInputBase-marginDense MuiInput-marginDense"
>
<input
aria-invalid="false"
class="MuiInputBase-input MuiInput-input MuiInputBase-inputMarginDense MuiInput-inputMarginDense"
data-testid="custom-nonce-input"
dir="auto"
id="custom-nonce-id"
min="0"
placeholder="1"
type="number"
value=""
/>
</div>
<input
autocomplete="off"
class="mm-box mm-text mm-input mm-input--disable-state-styles mm-text-field__input mm-text--body-md mm-box--margin-0 mm-box--padding-0 mm-box--padding-right-4 mm-box--padding-left-4 mm-box--color-text-default mm-box--background-color-transparent mm-box--border-style-none"
data-testid="custom-nonce-input"
focused="false"
id="custom-nonce-id"
placeholder="1"
type="number"
value=""
/>
</div>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,6 @@ const render = () => {
describe('UpdateNicknamePopover', () => {
it('renders UpdateNicknamePopover component and shows This is a memo text', () => {
render();
expect(screen.getByText('This is a memo')).toBeInTheDocument();
expect(screen.getByDisplayValue('This is a memo')).toBeInTheDocument();
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -472,7 +472,7 @@ exports[`Confirm Transaction Base should match snapshot 1`] = `
class="custom-nonce-input"
>
<div
class="mm-box mm-text-field mm-text-field--size-md mm-text-field--truncate mm-box--padding-right-0 mm-box--padding-left-0 mm-box--display-inline-flex mm-box--align-items-center mm-box--background-color-background-default mm-box--rounded-sm mm-box--border-width-1 box--border-style-solid"
class="mm-box mm-text-field mm-text-field--size-md mm-text-field--truncate mm-box--padding-right-0 mm-box--padding-left-0 mm-box--display-inline-flex mm-box--align-items-center mm-box--width-full mm-box--background-color-background-default mm-box--rounded-sm mm-box--border-width-1 box--border-style-solid"
min="0"
>
<input
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1017,15 +1017,15 @@ exports[`Security Tab should match snapshot 1`] = `
class="settings-page__content-item-col"
>
<div
class="MuiFormControl-root MuiTextField-root MuiFormControl-marginDense MuiFormControl-fullWidth"
class="mm-box mm-form-text-field mm-box--display-flex mm-box--flex-direction-column mm-box--width-full"
>
<div
class="MuiInputBase-root MuiInput-root TextField-inputRoot-12 MuiInputBase-fullWidth MuiInput-fullWidth MuiInputBase-formControl MuiInput-formControl MuiInputBase-marginDense MuiInput-marginDense"
class="mm-box mm-text-field mm-text-field--size-md mm-text-field--truncate mm-form-text-field__text-field mm-box--padding-right-0 mm-box--padding-left-0 mm-box--display-inline-flex mm-box--align-items-center mm-box--background-color-background-default mm-box--rounded-sm mm-box--border-width-1 box--border-style-solid"
>
<input
aria-invalid="false"
class="MuiInputBase-input MuiInput-input MuiInputBase-inputMarginDense MuiInput-inputMarginDense"
dir="auto"
autocomplete="off"
class="mm-box mm-text mm-input mm-input--disable-state-styles mm-text-field__input mm-text--body-md mm-box--margin-0 mm-box--padding-0 mm-box--padding-right-4 mm-box--padding-left-4 mm-box--color-text-default mm-box--background-color-transparent mm-box--border-style-none"
focused="false"
type="text"
value="dweb.link"
/>
Expand Down
5 changes: 3 additions & 2 deletions ui/pages/settings/security-tab/security-tab.component.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ import {
IconName,
Box,
Text,
TextField,
FormTextField,
} from '../../../components/component-library';
import ToggleButton from '../../../components/ui/toggle-button';
import Popover from '../../../components/ui/popover';
Expand Down Expand Up @@ -589,11 +589,12 @@ export default class SecurityTab extends PureComponent {
<div className="settings-page__content-item">
<span>{t('addIPFSGateway')}</span>
<div className="settings-page__content-item-col">
<TextField
<FormTextField
type="text"
value={this.state.ipfsGateway}
onChange={(e) => handleIpfsGatewayChange(e.target.value)}
error={this.state.ipfsGatewayError}
helpText={this.state.ipfsGatewayError}
width={BlockSize.Full}
margin="dense"
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,37 +2,32 @@

exports[`SearchableItemList renders the component with initial props 1`] = `
<div
class="MuiFormControl-root MuiTextField-root searchable-item-list__search MuiFormControl-fullWidth"
class="mm-box mm-text-field mm-text-field--size-md mm-text-field--focused mm-text-field--truncate searchable-item-list__search mm-box--padding-right-0 mm-box--padding-left-4 mm-box--display-inline-flex mm-box--align-items-center mm-box--width-full mm-box--background-color-background-default mm-box--rounded-sm mm-box--border-width-1 box--border-style-solid"
>
<div
class="MuiInputBase-root MuiInput-root TextField-inputRoot-12 MuiInputBase-fullWidth MuiInput-fullWidth Mui-focused Mui-focused TextField-inputFocused-11 MuiInputBase-formControl MuiInput-formControl MuiInputBase-adornedStart"
class="MuiInputAdornment-root MuiInputAdornment-positionStart"
style="margin-right: 12px;"
>
<div
class="MuiInputAdornment-root MuiInputAdornment-positionStart"
style="margin-right: 12px;"
<svg
fill="var(--color-icon-muted)"
height="20"
viewBox="0 0 512 512"
width="20"
xmlns="http://www.w3.org/2000/svg"
>
<svg
fill="var(--color-icon-muted)"
height="20"
viewBox="0 0 512 512"
width="20"
xmlns="http://www.w3.org/2000/svg"
>
<path
d="m235 427c-51 0-100-21-136-57-36-36-56-84-56-135 0-26 5-51 14-74 10-23 24-44 42-62 18-18 39-32 62-42 23-9 48-14 74-14 25 0 50 5 73 14 23 10 45 24 62 42 18 18 32 39 42 62 10 23 15 48 15 74 0 43-15 86-42 119l78 79c2 2 4 4 5 7 1 2 1 5 1 8 0 3 0 6-1 8-1 3-3 5-5 7-2 2-4 4-7 5-2 1-5 1-8 1-3 0-6 0-8-1-3-1-5-3-7-5l-79-78c-33 27-76 42-119 42z m0-43c82 0 149-67 149-149 0-83-67-150-149-150-83 0-150 67-150 150 0 82 67 149 150 149z"
/>
</svg>
</div>
<input
aria-invalid="false"
autocomplete="off"
class="MuiInputBase-input MuiInput-input MuiInputBase-inputAdornedStart"
data-testid="search-list-items"
dir="auto"
type="text"
value=""
/>
<path
d="m235 427c-51 0-100-21-136-57-36-36-56-84-56-135 0-26 5-51 14-74 10-23 24-44 42-62 18-18 39-32 62-42 23-9 48-14 74-14 25 0 50 5 73 14 23 10 45 24 62 42 18 18 32 39 42 62 10 23 15 48 15 74 0 43-15 86-42 119l78 79c2 2 4 4 5 7 1 2 1 5 1 8 0 3 0 6-1 8-1 3-3 5-5 7-2 2-4 4-7 5-2 1-5 1-8 1-3 0-6 0-8-1-3-1-5-3-7-5l-79-78c-33 27-76 42-119 42z m0-43c82 0 149-67 149-149 0-83-67-150-149-150-83 0-150 67-150 150 0 82 67 149 150 149z"
/>
</svg>
</div>
<input
autocomplete="on"
class="mm-box mm-text mm-input mm-input--disable-state-styles mm-text-field__input mm-text--body-md mm-box--margin-0 mm-box--padding-0 mm-box--padding-right-4 mm-box--padding-left-2 mm-box--color-text-default mm-box--background-color-transparent mm-box--border-style-none"
data-testid="search-list-items"
focused="true"
type="text"
value=""
/>
</div>
`;

Expand Down

0 comments on commit 8f7eb91

Please sign in to comment.