-
Notifications
You must be signed in to change notification settings - Fork 578
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
The snaps part of the code needed for [#3068](MetaMask/MetaMask-planning#3068)
- Loading branch information
Showing
34 changed files
with
286 additions
and
29 deletions.
There are no files selected for viewing
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
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
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
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,118 @@ | ||
import { Address } from './Address'; | ||
import { Row } from './Row'; | ||
import { Section } from './Section'; | ||
import { Text } from './Text'; | ||
|
||
describe('Section', () => { | ||
it('renders a section', () => { | ||
const result = ( | ||
<Section> | ||
<Text>Hello</Text> | ||
</Section> | ||
); | ||
|
||
expect(result).toStrictEqual({ | ||
type: 'Section', | ||
key: null, | ||
props: { | ||
children: { | ||
type: 'Text', | ||
key: null, | ||
props: { | ||
children: 'Hello', | ||
}, | ||
}, | ||
}, | ||
}); | ||
}); | ||
|
||
it('renders a section with multiple children', () => { | ||
const result = ( | ||
<Section> | ||
<Row label="From"> | ||
<Address address="0x1234567890123456789012345678901234567890" /> | ||
</Row> | ||
<Row | ||
label="To" | ||
variant="warning" | ||
tooltip="This address has been deemed dangerous." | ||
> | ||
<Address address="0x0000000000000000000000000000000000000000" /> | ||
</Row> | ||
</Section> | ||
); | ||
|
||
expect(result).toStrictEqual({ | ||
type: 'Section', | ||
key: null, | ||
props: { | ||
children: [ | ||
{ | ||
type: 'Row', | ||
key: null, | ||
props: { | ||
label: 'From', | ||
children: { | ||
type: 'Address', | ||
key: null, | ||
props: { | ||
address: '0x1234567890123456789012345678901234567890', | ||
}, | ||
}, | ||
}, | ||
}, | ||
{ | ||
type: 'Row', | ||
key: null, | ||
props: { | ||
label: 'To', | ||
tooltip: 'This address has been deemed dangerous.', | ||
variant: 'warning', | ||
children: { | ||
type: 'Address', | ||
key: null, | ||
props: { | ||
address: '0x0000000000000000000000000000000000000000', | ||
}, | ||
}, | ||
}, | ||
}, | ||
], | ||
}, | ||
}); | ||
}); | ||
|
||
it('renders a section with props', () => { | ||
const result = ( | ||
<Section direction="horizontal" alignment="space-between"> | ||
<Text>Hello</Text> | ||
<Text>World</Text> | ||
</Section> | ||
); | ||
|
||
expect(result).toStrictEqual({ | ||
type: 'Section', | ||
key: null, | ||
props: { | ||
direction: 'horizontal', | ||
alignment: 'space-between', | ||
children: [ | ||
{ | ||
type: 'Text', | ||
key: null, | ||
props: { | ||
children: 'Hello', | ||
}, | ||
}, | ||
{ | ||
type: 'Text', | ||
key: null, | ||
props: { | ||
children: 'World', | ||
}, | ||
}, | ||
], | ||
}, | ||
}); | ||
}); | ||
}); |
Oops, something went wrong.