Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: increment unit tests coverage #1044

Merged
merged 71 commits into from
Nov 17, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
71 commits
Select commit Hold shift + click to select a range
5f0a496
fix unit tests
MonikaCat Oct 17, 2022
a007404
add cutom tool tip unit tests
MonikaCat Oct 18, 2022
b28873f
add desmos profile unit tests
MonikaCat Oct 18, 2022
3cc9507
added linear loading unit tests
MonikaCat Oct 18, 2022
62b67a2
added load and exist unit tests
MonikaCat Oct 18, 2022
626a933
added info popover unit tests
MonikaCat Oct 18, 2022
625e851
added msg ibc unit tests
MonikaCat Oct 19, 2022
d93602d
added msg/ibc_transfer unit tests
MonikaCat Oct 20, 2022
1092c0b
added name unit tests
MonikaCat Oct 20, 2022
2b021e4
added setting list unit tests
MonikaCat Oct 20, 2022
e772621
added single network unit tests
MonikaCat Oct 20, 2022
dc2d08c
added no data & not found unit tests
MonikaCat Oct 20, 2022
9cc7221
added single proposal unit tests
MonikaCat Oct 20, 2022
5a23931
added single tx mobile unit tests
MonikaCat Oct 20, 2022
5329384
added sort arrows & tab panel unit tests
MonikaCat Oct 20, 2022
924f7c2
added avatar name list msg unit tests
MonikaCat Oct 20, 2022
c38d57c
added condition expl unit tests
MonikaCat Oct 20, 2022
0b9948a
updated load and exist unit tests
MonikaCat Oct 20, 2022
c53eb7d
updated avatar_name_list_msg unit tests
MonikaCat Oct 20, 2022
bbc3779
added validaor screen unit tests
MonikaCat Oct 21, 2022
402abce
updated validators/list/mobile unit tests
MonikaCat Oct 21, 2022
027f077
updated avatar name list msg unit tests
MonikaCat Oct 21, 2022
bb64fd6
added screens/initial_load unit tests
MonikaCat Oct 21, 2022
073d6a4
updted screens/block_details txs unit tests
MonikaCat Oct 21, 2022
9936659
added msg governance SoftwareUpgradeProposal, TextProposal, Parameter…
MonikaCat Oct 21, 2022
78c2dc5
updated msg/gov/vote
MonikaCat Oct 24, 2022
cf9d1a4
added account details overview hooks unit tests
MonikaCat Oct 24, 2022
9f6de19
added nav action bar settng list hooks ut
MonikaCat Oct 24, 2022
46c85f9
added desmos profile hooks tests
MonikaCat Oct 28, 2022
fcc6505
updated msg/bank/send
MonikaCat Nov 1, 2022
30c10ba
updated proposals list unit test
MonikaCat Nov 2, 2022
6259b7b
updated validators list unit test
MonikaCat Nov 2, 2022
f6c8ae9
added transaction message filter unit tests
MonikaCat Nov 3, 2022
2a18ec6
added transactios list unit tests
MonikaCat Nov 3, 2022
348711f
added transactions list details unit tests
MonikaCat Nov 3, 2022
25bf67d
updated desc
MonikaCat Nov 3, 2022
0272082
added transactions list details/list unit tests
MonikaCat Nov 3, 2022
a86ab0d
added pagination actions unit tests
MonikaCat Nov 4, 2022
5d5fc83
updated msg bank multisend unit tests
MonikaCat Nov 4, 2022
2e7a846
updated msg bank multisend unit tests
MonikaCat Nov 4, 2022
af6e1a4
updated msg bank send unit tests
MonikaCat Nov 4, 2022
7183be6
updated msg distribution fund unit tests
MonikaCat Nov 4, 2022
2b69f3c
updated msg authz unit tests
MonikaCat Nov 4, 2022
bc09b7e
updated msg governance unit tests
MonikaCat Nov 4, 2022
8849932
updated msg ibc unit tests
MonikaCat Nov 4, 2022
9b983ed
updated msg ibc transfer unit tests
MonikaCat Nov 4, 2022
b717d52
updated msg profiles unit tests
MonikaCat Nov 4, 2022
ff1c29f
updated msg slashing unit tests
MonikaCat Nov 4, 2022
9bf41db
updated msg staking unit tests
MonikaCat Nov 4, 2022
7149fae
updated msg unknown unit tests
MonikaCat Nov 4, 2022
78dbe6b
updated msg vesting unit tests
MonikaCat Nov 4, 2022
31bb6ee
updated msg crisis unit tests
MonikaCat Nov 4, 2022
288236e
updated msg distribution unit tests
MonikaCat Nov 4, 2022
b00df09
updated msg feegrant unit tests
MonikaCat Nov 4, 2022
3044648
updated msg gov unit tests
MonikaCat Nov 4, 2022
8f34aec
updated nav unit tests
MonikaCat Nov 4, 2022
aad8546
updated hero unit tests
MonikaCat Nov 4, 2022
88112fd
updated block details transactions unit tests
MonikaCat Nov 4, 2022
e89d64e
added validators list unit tests
MonikaCat Nov 7, 2022
5143841
updated screens blocks mocks
MonikaCat Nov 7, 2022
a7085f8
updated screens app mocks
MonikaCat Nov 7, 2022
14e9cea
updated transacyon list details unit tests
MonikaCat Nov 7, 2022
6dda9e3
updated nav networks unit tests
MonikaCat Nov 8, 2022
b8c0e44
update tx list unit tests
MonikaCat Nov 8, 2022
49098ef
update account details overview unit tests
MonikaCat Nov 8, 2022
4cb3660
updated unit tests
MonikaCat Nov 8, 2022
53937b8
added inner app unit tests
MonikaCat Nov 8, 2022
9893fda
added CHANGELOG.md entry
MonikaCat Nov 8, 2022
a2cf285
.
MonikaCat Nov 8, 2022
8dcbfb8
updated inner app unit tests
MonikaCat Nov 8, 2022
59760f2
updated msg gov
MonikaCat Nov 8, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
- Added Sentry's Next.js SDK ([\#1005](https://github.com/forbole/big-dipper-2.0-cosmos/issues/1005))
- Switched from using `npm` to `yarn berry` package manager ([\#1028](https://github.com/forbole/big-dipper-2.0-cosmos/pull/1028))
- Added message type to transactions ([\#1034](https://github.com/forbole/big-dipper-2.0-cosmos/issues/1034))
- Incremented unit tests coverage ([\#1044](https://github.com/forbole/big-dipper-2.0-cosmos/pull/1044))


# base-v2.1.2 - 2022-09-11
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`components: AvatarNameListMsg matches snapshot 1`] = `
<a
className="MuiTypography-root makeStyles-root MuiTypography-body1"
href="/accounts/desmos1jrld5g998gqm4yx26l6cvhxz7y5adgxquy94nz"
onClick={[Function]}
onMouseEnter={[Function]}
onTouchStart={[Function]}
>
name
</a>
`;

exports[`components: AvatarNameListMsg matches snapshot with empty values 1`] = `null`;

exports[`components: AvatarNameListMsg matches snapshot with multiple values 1`] = `
Array [
<a
className="MuiTypography-root makeStyles-root MuiTypography-body1"
href="/accounts/desmos1jrld5g998gqm4yx26l6cvhxz7y5adgxquy94nz"
onClick={[Function]}
onMouseEnter={[Function]}
onTouchStart={[Function]}
>
name-1
</a>,
" ",
"and",
" ",
<a
className="MuiTypography-root makeStyles-root MuiTypography-body1"
href="/accounts/desmos1jrld5g998gqm4yx26l6cvhxz7y5adgxquy94xx"
onClick={[Function]}
onMouseEnter={[Function]}
onTouchStart={[Function]}
>
name-2
</a>,
]
`;
69 changes: 69 additions & 0 deletions src/components/avatar_name_list_msg/index.test.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
import React from 'react';
import renderer from 'react-test-renderer';
import { MockTheme } from '@tests/utils';
import {
AvatarNameListMsg,
} from '@components';

// ==================================
// unit tests
// ==================================
describe('components: AvatarNameListMsg', () => {
it('matches snapshot', () => {
const component = renderer.create(
<MockTheme>
<AvatarNameListMsg
avatars={[
{
imageUrl: '',
address: 'desmos1jrld5g998gqm4yx26l6cvhxz7y5adgxquy94nz',
name: 'name',
},

]}
/>
</MockTheme>,
);
const tree = component.toJSON();
expect(tree).toMatchSnapshot();
});

it('matches snapshot with empty values', () => {
const component = renderer.create(
<MockTheme>
<AvatarNameListMsg
avatars={[]}
/>
</MockTheme>,
);
const tree = component.toJSON();
expect(tree).toMatchSnapshot();
});

it('matches snapshot with multiple values', () => {
const component = renderer.create(
<MockTheme>
<AvatarNameListMsg
avatars={[
{
imageUrl: '',
address: 'desmos1jrld5g998gqm4yx26l6cvhxz7y5adgxquy94nz',
name: 'name-1',
},
{
imageUrl: '',
address: 'desmos1jrld5g998gqm4yx26l6cvhxz7y5adgxquy94xx',
name: 'name-2',
},
]}
/>
</MockTheme>,
);
const tree = component.toJSON();
expect(tree).toMatchSnapshot();
});

afterEach(() => {
jest.clearAllMocks();
});
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`components: ConditionExplanation matches snapshot 1`] = `
<div
className="makeStyles-root"
>
<p
className="MuiTypography-root MuiTypography-body1"
>
conditionExplanation
</p>
<div
className="makeStyles-itemWrapper"
>
<div
className="makeStyles-item"
>
<p
className="MuiTypography-root MuiTypography-body1"
>
90% - 100%
</p>
<div
className="makeStyles-condition green"
/>
</div>
<div
className="makeStyles-item"
>
<p
className="MuiTypography-root MuiTypography-body1"
>
70% - 90%
</p>
<div
className="makeStyles-condition yellow"
/>
</div>
<div
className="makeStyles-item"
>
<p
className="MuiTypography-root MuiTypography-body1"
>
1% - 70%
</p>
<div
className="makeStyles-condition red"
/>
</div>
<div
className="makeStyles-item"
>
<p
className="MuiTypography-root MuiTypography-body1"
>
0%
</p>
<div
className="makeStyles-condition"
/>
</div>
</div>
</div>
`;
23 changes: 23 additions & 0 deletions src/components/condition_explanation/index.test.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import React from 'react';
import renderer from 'react-test-renderer';
import { MockTheme } from '@tests/utils';
import ConditionExplanation from '.';

// ==================================
// unit tests
// ==================================
describe('components: ConditionExplanation', () => {
it('matches snapshot', () => {
const component = renderer.create(
<MockTheme>
<ConditionExplanation />
</MockTheme>,
);
const tree = component.toJSON();
expect(tree).toMatchSnapshot();
});

afterEach(() => {
jest.clearAllMocks();
});
});
116 changes: 116 additions & 0 deletions src/components/custom_tool_tip/__snapshots__/index.test.tsx.snap
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`component: CustomToolTip matches snapshot 1`] = `
<div
className="recharts-wrapper"
style={
Object {
"cursor": "default",
"height": 100,
"position": "relative",
"width": 200,
}
}
>
<svg
className="recharts-surface"
cx="50%"
cy={100}
height={100}
version="1.1"
viewBox="0 0 200 100"
width={200}
>
<defs>
<clipPath
id="recharts1-clip"
>
<rect
height={90}
width={190}
x={5}
y={5}
/>
</clipPath>
</defs>
<g
className="recharts-layer recharts-pie"
>
<g
className="recharts-layer recharts-pie-sector"
onMouseEnter={[Function]}
onMouseLeave={[Function]}
>
<path
className="recharts-sector"
cx={100}
cy={95}
d="M 10,94.99999999999999
A 90,90,0,
0,1,
152.90067270632255,22.188470506254717
L 100,95 Z"
fill="#5451CB"
name={0}
stroke="none"
/>
</g>
<g
className="recharts-layer recharts-pie-sector"
onMouseEnter={[Function]}
onMouseLeave={[Function]}
>
<path
className="recharts-sector"
cx={100}
cy={95}
d="M 152.90067270632255,22.188470506254717
A 90,90,0,
0,1,
172.81152949374524,42.099327293677405
L 100,95 Z"
fill="#773CAA"
name={1}
stroke="none"
/>
</g>
<g
className="recharts-layer recharts-pie-sector"
onMouseEnter={[Function]}
onMouseLeave={[Function]}
>
<path
className="recharts-sector"
cx={100}
cy={95}
d="M 172.81152949374524,42.099327293677405
A 90,90,0,
0,1,
190,94.99999999999997
L 100,95 Z"
fill="CA4D4D"
name={2}
stroke="none"
/>
</g>
</g>
</svg>
<div
className="recharts-tooltip-wrapper"
style={
Object {
"MozTransform": "translate(undefinedpx, undefinedpx)",
"OTransform": "translate(undefinedpx, undefinedpx)",
"WebkitTransform": "translate(undefinedpx, undefinedpx)",
"left": 0,
"msTransform": "translate(undefinedpx, undefinedpx)",
"pointerEvents": "none",
"position": "absolute",
"top": 0,
"transform": "translate(undefinedpx, undefinedpx)",
"visibility": "hidden",
}
}
/>
</div>
`;
Loading