@oanda/labs-value-at-risk-widget 1.0.64 → 1.0.66

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (139) hide show
  1. package/CHANGELOG.md +532 -0
  2. package/dist/main/ValueAtRiskWidget/ChartWithData.js +6 -8
  3. package/dist/main/ValueAtRiskWidget/ChartWithData.js.map +1 -1
  4. package/dist/main/ValueAtRiskWidget/Tool.js +13 -13
  5. package/dist/main/ValueAtRiskWidget/Tool.js.map +1 -1
  6. package/dist/main/ValueAtRiskWidget/ToolWithData.js +4 -6
  7. package/dist/main/ValueAtRiskWidget/ToolWithData.js.map +1 -1
  8. package/dist/main/ValueAtRiskWidget/ValueAtRiskWidget.js +17 -22
  9. package/dist/main/ValueAtRiskWidget/ValueAtRiskWidget.js.map +1 -1
  10. package/dist/main/ValueAtRiskWidget/Widget.js +7 -9
  11. package/dist/main/ValueAtRiskWidget/Widget.js.map +1 -1
  12. package/dist/main/ValueAtRiskWidget/components/Chart/Chart.js +10 -10
  13. package/dist/main/ValueAtRiskWidget/components/Chart/Chart.js.map +1 -1
  14. package/dist/main/ValueAtRiskWidget/components/Chart/getOption.js.map +1 -1
  15. package/dist/main/ValueAtRiskWidget/components/Chart/types.js.map +1 -1
  16. package/dist/main/ValueAtRiskWidget/components/Legend/DashedLine.js +6 -6
  17. package/dist/main/ValueAtRiskWidget/components/Legend/DashedLine.js.map +1 -1
  18. package/dist/main/ValueAtRiskWidget/components/Legend/DesktopLegend.js +3 -3
  19. package/dist/main/ValueAtRiskWidget/components/Legend/DesktopLegend.js.map +1 -1
  20. package/dist/main/ValueAtRiskWidget/components/Legend/Legend.js +13 -14
  21. package/dist/main/ValueAtRiskWidget/components/Legend/Legend.js.map +1 -1
  22. package/dist/main/ValueAtRiskWidget/components/Legend/MobileLegend.js +5 -5
  23. package/dist/main/ValueAtRiskWidget/components/Legend/MobileLegend.js.map +1 -1
  24. package/dist/main/ValueAtRiskWidget/components/Legend/constants.js.map +1 -1
  25. package/dist/main/ValueAtRiskWidget/components/Legend/types.js.map +1 -1
  26. package/dist/main/ValueAtRiskWidget/render.js +9 -9
  27. package/dist/main/ValueAtRiskWidget/render.js.map +1 -1
  28. package/dist/main/ValueAtRiskWidget/types.js.map +1 -1
  29. package/dist/main/ValueAtRiskWidget/utils.js.map +1 -1
  30. package/dist/main/gql/getValueAtRiskAssetClasses.js +1 -1
  31. package/dist/main/gql/getValueAtRiskAssetClasses.js.map +1 -1
  32. package/dist/main/gql/getValueAtRiskChart.js +12 -2
  33. package/dist/main/gql/getValueAtRiskChart.js.map +1 -1
  34. package/dist/main/gql/types/fragment-masking.js.map +1 -1
  35. package/dist/main/gql/types/gql.js +2 -2
  36. package/dist/main/gql/types/gql.js.map +1 -1
  37. package/dist/main/gql/types/graphql.js +241 -241
  38. package/dist/main/gql/types/graphql.js.map +1 -1
  39. package/dist/main/gql/types/index.js.map +1 -1
  40. package/dist/main/translations/index.js +1 -1
  41. package/dist/main/translations/index.js.map +1 -1
  42. package/dist/main/translations/translations.js.map +1 -1
  43. package/dist/module/ValueAtRiskWidget/ChartWithData.js +7 -7
  44. package/dist/module/ValueAtRiskWidget/ChartWithData.js.map +1 -1
  45. package/dist/module/ValueAtRiskWidget/Tool.js +14 -14
  46. package/dist/module/ValueAtRiskWidget/Tool.js.map +1 -1
  47. package/dist/module/ValueAtRiskWidget/ToolWithData.js +4 -4
  48. package/dist/module/ValueAtRiskWidget/ToolWithData.js.map +1 -1
  49. package/dist/module/ValueAtRiskWidget/ValueAtRiskWidget.js +18 -23
  50. package/dist/module/ValueAtRiskWidget/ValueAtRiskWidget.js.map +1 -1
  51. package/dist/module/ValueAtRiskWidget/Widget.js +8 -8
  52. package/dist/module/ValueAtRiskWidget/Widget.js.map +1 -1
  53. package/dist/module/ValueAtRiskWidget/components/Chart/Chart.js +9 -9
  54. package/dist/module/ValueAtRiskWidget/components/Chart/Chart.js.map +1 -1
  55. package/dist/module/ValueAtRiskWidget/components/Chart/getOption.js +1 -1
  56. package/dist/module/ValueAtRiskWidget/components/Chart/getOption.js.map +1 -1
  57. package/dist/module/ValueAtRiskWidget/components/Chart/types.js.map +1 -1
  58. package/dist/module/ValueAtRiskWidget/components/Legend/DashedLine.js +6 -6
  59. package/dist/module/ValueAtRiskWidget/components/Legend/DashedLine.js.map +1 -1
  60. package/dist/module/ValueAtRiskWidget/components/Legend/DesktopLegend.js +3 -3
  61. package/dist/module/ValueAtRiskWidget/components/Legend/DesktopLegend.js.map +1 -1
  62. package/dist/module/ValueAtRiskWidget/components/Legend/Legend.js +13 -13
  63. package/dist/module/ValueAtRiskWidget/components/Legend/Legend.js.map +1 -1
  64. package/dist/module/ValueAtRiskWidget/components/Legend/MobileLegend.js +5 -5
  65. package/dist/module/ValueAtRiskWidget/components/Legend/MobileLegend.js.map +1 -1
  66. package/dist/module/ValueAtRiskWidget/components/Legend/constants.js.map +1 -1
  67. package/dist/module/ValueAtRiskWidget/components/Legend/types.js.map +1 -1
  68. package/dist/module/ValueAtRiskWidget/render.js +9 -9
  69. package/dist/module/ValueAtRiskWidget/render.js.map +1 -1
  70. package/dist/module/ValueAtRiskWidget/types.js.map +1 -1
  71. package/dist/module/ValueAtRiskWidget/utils.js +1 -1
  72. package/dist/module/ValueAtRiskWidget/utils.js.map +1 -1
  73. package/dist/module/gql/getValueAtRiskAssetClasses.js +1 -1
  74. package/dist/module/gql/getValueAtRiskAssetClasses.js.map +1 -1
  75. package/dist/module/gql/getValueAtRiskChart.js +12 -2
  76. package/dist/module/gql/getValueAtRiskChart.js.map +1 -1
  77. package/dist/module/gql/types/fragment-masking.js.map +1 -1
  78. package/dist/module/gql/types/gql.js +2 -2
  79. package/dist/module/gql/types/gql.js.map +1 -1
  80. package/dist/module/gql/types/graphql.js +241 -241
  81. package/dist/module/gql/types/graphql.js.map +1 -1
  82. package/dist/module/gql/types/index.js +2 -2
  83. package/dist/module/gql/types/index.js.map +1 -1
  84. package/dist/module/translations/index.js +1 -1
  85. package/dist/module/translations/index.js.map +1 -1
  86. package/dist/module/translations/translations.js.map +1 -1
  87. package/dist/types/ValueAtRiskWidget/ChartWithData.d.ts +1 -1
  88. package/dist/types/ValueAtRiskWidget/Tool.d.ts +1 -1
  89. package/dist/types/ValueAtRiskWidget/ToolWithData.d.ts +1 -1
  90. package/dist/types/ValueAtRiskWidget/ValueAtRiskWidget.d.ts +1 -1
  91. package/dist/types/ValueAtRiskWidget/Widget.d.ts +2 -2
  92. package/dist/types/ValueAtRiskWidget/components/Chart/Chart.d.ts +1 -1
  93. package/dist/types/ValueAtRiskWidget/components/Chart/getOption.d.ts +1 -1
  94. package/dist/types/ValueAtRiskWidget/components/Chart/types.d.ts +2 -2
  95. package/dist/types/ValueAtRiskWidget/components/Legend/DashedLine.d.ts +2 -2
  96. package/dist/types/ValueAtRiskWidget/components/Legend/DesktopLegend.d.ts +1 -1
  97. package/dist/types/ValueAtRiskWidget/components/Legend/Legend.d.ts +1 -1
  98. package/dist/types/ValueAtRiskWidget/components/Legend/MobileLegend.d.ts +1 -1
  99. package/dist/types/ValueAtRiskWidget/components/Legend/constants.d.ts +1 -1
  100. package/dist/types/ValueAtRiskWidget/components/Legend/types.d.ts +1 -1
  101. package/dist/types/ValueAtRiskWidget/types.d.ts +2 -2
  102. package/dist/types/ValueAtRiskWidget/utils.d.ts +2 -2
  103. package/dist/types/gql/types/gql.d.ts +4 -4
  104. package/dist/types/gql/types/index.d.ts +2 -2
  105. package/dist/types/translations/index.d.ts +2 -2
  106. package/package.json +3 -3
  107. package/src/ValueAtRiskWidget/ChartWithData.tsx +47 -28
  108. package/src/ValueAtRiskWidget/Tool.tsx +43 -29
  109. package/src/ValueAtRiskWidget/ToolWithData.tsx +30 -24
  110. package/src/ValueAtRiskWidget/ValueAtRiskWidget.tsx +27 -32
  111. package/src/ValueAtRiskWidget/Widget.tsx +9 -13
  112. package/src/ValueAtRiskWidget/components/Chart/Chart.tsx +21 -20
  113. package/src/ValueAtRiskWidget/components/Chart/getOption.ts +4 -4
  114. package/src/ValueAtRiskWidget/components/Chart/types.ts +4 -3
  115. package/src/ValueAtRiskWidget/components/Legend/DashedLine.tsx +18 -8
  116. package/src/ValueAtRiskWidget/components/Legend/DesktopLegend.tsx +28 -19
  117. package/src/ValueAtRiskWidget/components/Legend/Legend.tsx +12 -15
  118. package/src/ValueAtRiskWidget/components/Legend/MobileLegend.tsx +40 -22
  119. package/src/ValueAtRiskWidget/components/Legend/constants.tsx +1 -1
  120. package/src/ValueAtRiskWidget/components/Legend/types.tsx +9 -9
  121. package/src/ValueAtRiskWidget/render.tsx +22 -24
  122. package/src/ValueAtRiskWidget/types.ts +7 -3
  123. package/src/ValueAtRiskWidget/utils.ts +18 -10
  124. package/src/gql/getValueAtRiskAssetClasses.ts +1 -1
  125. package/src/gql/getValueAtRiskChart.ts +12 -2
  126. package/src/gql/types/fragment-masking.ts +41 -21
  127. package/src/gql/types/gql.ts +12 -5
  128. package/src/gql/types/graphql.ts +339 -47
  129. package/src/gql/types/index.ts +2 -2
  130. package/src/translations/index.ts +4 -4
  131. package/src/translations/translations.ts +1 -3
  132. package/test/ChartWithData.test.tsx +28 -20
  133. package/test/Tool.test.tsx +39 -25
  134. package/test/ToolWithData.test.tsx +21 -10
  135. package/test/Widget.test.tsx +15 -10
  136. package/test/getPercentValueByPips.test.ts +15 -3
  137. package/test/mocks/assetClassesMock.ts +1 -3
  138. package/test/mocks/responsesMocks.ts +6 -2
  139. package/test/utils.test.ts +14 -7
@@ -1,27 +1,35 @@
1
1
  /**
2
2
  * @jest-environment jsdom
3
3
  */
4
- import React from 'react';
5
- import { render } from '@testing-library/react';
6
4
  import { MockedProvider } from '@apollo/client/testing';
7
- import { Size, ThemeContext } from '@oanda/labs-widget-common';
8
- import { Division, ValueAtRiskBars, ValueAtRiskDuration } from '../src/gql/types/graphql';
9
- import { getValueAtRiskChartErrorMock, getValueAtRiskChartMock } from './mocks/responsesMocks';
5
+ import { MockLayoutProvider } from '@oanda/labs-widget-common';
6
+ import { render } from '@testing-library/react';
7
+ import React from 'react';
8
+
9
+ import {
10
+ Division,
11
+ ValueAtRiskBars,
12
+ ValueAtRiskDuration,
13
+ } from '../src/gql/types/graphql';
10
14
  import { ChartWithData } from '../src/ValueAtRiskWidget/ChartWithData';
15
+ import {
16
+ getValueAtRiskChartErrorMock,
17
+ getValueAtRiskChartMock,
18
+ } from './mocks/responsesMocks';
11
19
 
12
20
  describe('ChartWithData component', () => {
13
21
  it('should render chart view', async () => {
14
22
  const { findByTestId } = render(
15
23
  <MockedProvider mocks={getValueAtRiskChartMock('CORN')}>
16
- <ThemeContext.Provider value={{ size: Size.DESKTOP, isDark: false }}>
24
+ <MockLayoutProvider isDark={false}>
17
25
  <ChartWithData
18
- division={Division.Oc}
19
- instrument="CORN"
20
26
  bars={ValueAtRiskBars.C100}
27
+ division={Division.Oc}
21
28
  duration={ValueAtRiskDuration.C1}
29
+ instrument="CORN"
22
30
  />
23
- </ThemeContext.Provider>
24
- </MockedProvider>,
31
+ </MockLayoutProvider>
32
+ </MockedProvider>
25
33
  );
26
34
 
27
35
  expect(await findByTestId('value-at-risk-chart')).toBeInTheDocument();
@@ -30,15 +38,15 @@ describe('ChartWithData component', () => {
30
38
  it('should render mobile chart view', async () => {
31
39
  const { findByTestId } = render(
32
40
  <MockedProvider mocks={getValueAtRiskChartMock('CORN')}>
33
- <ThemeContext.Provider value={{ size: Size.MOBILE, isDark: false }}>
41
+ <MockLayoutProvider isDark={false}>
34
42
  <ChartWithData
35
- division={Division.Oc}
36
- instrument="CORN"
37
43
  bars={ValueAtRiskBars.C100}
44
+ division={Division.Oc}
38
45
  duration={ValueAtRiskDuration.C1}
46
+ instrument="CORN"
39
47
  />
40
- </ThemeContext.Provider>
41
- </MockedProvider>,
48
+ </MockLayoutProvider>
49
+ </MockedProvider>
42
50
  );
43
51
 
44
52
  expect(await findByTestId('value-at-risk-chart')).toBeInTheDocument();
@@ -47,15 +55,15 @@ describe('ChartWithData component', () => {
47
55
  it('should render error view', async () => {
48
56
  const { findByTestId } = render(
49
57
  <MockedProvider mocks={getValueAtRiskChartErrorMock}>
50
- <ThemeContext.Provider value={{ size: Size.DESKTOP, isDark: false }}>
58
+ <MockLayoutProvider isDark={false}>
51
59
  <ChartWithData
52
- division={Division.Oc}
53
- instrument="AUD_USD"
54
60
  bars={ValueAtRiskBars.C100}
61
+ division={Division.Oc}
55
62
  duration={ValueAtRiskDuration.C1}
63
+ instrument="AUD_USD"
56
64
  />
57
- </ThemeContext.Provider>
58
- </MockedProvider>,
65
+ </MockLayoutProvider>
66
+ </MockedProvider>
59
67
  );
60
68
 
61
69
  expect(await findByTestId('chart-error')).toBeInTheDocument();
@@ -1,13 +1,14 @@
1
1
  /**
2
2
  * @jest-environment jsdom
3
3
  */
4
- import React from 'react';
5
- import { render, fireEvent } from '@testing-library/react';
6
- import { ThemeContext, Size } from '@oanda/labs-widget-common';
7
4
  import { MockedProvider } from '@apollo/client/testing';
5
+ import { MockLayoutProvider } from '@oanda/labs-widget-common';
6
+ import { fireEvent, render } from '@testing-library/react';
7
+ import React from 'react';
8
+
9
+ import { Division } from '../src/gql/types/graphql';
8
10
  import { Tool } from '../src/ValueAtRiskWidget/Tool';
9
11
  import { assetClassesMock, getValueAtRiskChartMock } from './mocks';
10
- import { Division } from '../src/gql/types/graphql';
11
12
 
12
13
  const data = {
13
14
  valueAtRiskAssetClasses: assetClassesMock,
@@ -17,37 +18,50 @@ describe('Tool component', () => {
17
18
  it('should render tool view', () => {
18
19
  const { getByTestId } = render(
19
20
  <MockedProvider mocks={getValueAtRiskChartMock()}>
20
- <ThemeContext.Provider value={{ size: Size.DESKTOP, isDark: true }}>
21
- <Tool
22
- data={data}
23
- division={Division.Oc}
24
- />
25
- </ThemeContext.Provider>
26
- </MockedProvider>,
21
+ <MockLayoutProvider>
22
+ <Tool data={data} division={Division.Oc} />
23
+ </MockLayoutProvider>
24
+ </MockedProvider>
27
25
  );
28
26
 
29
27
  expect(getByTestId('value-at-risk-tool-wrapper')).toBeInTheDocument();
30
28
  });
31
29
  it('should change asset class and instruments list on click', () => {
32
30
  const { container, getByTestId } = render(
33
- <MockedProvider mocks={[...getValueAtRiskChartMock('AUD_USD'), ...getValueAtRiskChartMock('AUS200')]}>
34
- <ThemeContext.Provider value={{ size: Size.DESKTOP, isDark: true }}>
35
- <Tool
36
- data={data}
37
- division={Division.Oc}
38
- />
39
- </ThemeContext.Provider>
40
- </MockedProvider>,
31
+ <MockedProvider
32
+ mocks={[
33
+ ...getValueAtRiskChartMock('AUD_USD'),
34
+ ...getValueAtRiskChartMock('AUS200'),
35
+ ]}
36
+ >
37
+ <MockLayoutProvider>
38
+ <Tool data={data} division={Division.Oc} />
39
+ </MockLayoutProvider>
40
+ </MockedProvider>
41
41
  );
42
42
  expect(getByTestId('value-at-risk-tool-wrapper')).toBeInTheDocument();
43
- expect(container.querySelector('div[data-testid="select"] div')).toHaveTextContent('Currency');
44
- expect(container.querySelector('div[data-testid="select"]:nth-child(2) div')).toHaveTextContent('AUD/USD');
43
+ expect(
44
+ container.querySelector('div[data-testid="select"] div')
45
+ ).toHaveTextContent('Currency');
46
+ expect(
47
+ container.querySelector('div[data-testid="select"]:nth-child(2) div')
48
+ ).toHaveTextContent('AUD/USD');
45
49
 
46
- fireEvent.click(container.querySelector('div[data-testid="select"] div') as any);
50
+ fireEvent.click(
51
+ container.querySelector('div[data-testid="select"] div') as any
52
+ );
47
53
 
48
- fireEvent.click(container.querySelector('ul[data-testid="select-options"] li:nth-child(2) button') as any);
54
+ fireEvent.click(
55
+ container.querySelector(
56
+ 'ul[data-testid="select-options"] li:nth-child(2) button'
57
+ ) as any
58
+ );
49
59
 
50
- expect(container.querySelector('div[data-testid="select"] div')).toHaveTextContent('Indices');
51
- expect(container.querySelector('div[data-testid="select"]:nth-child(2) div')).toHaveTextContent('Australia 200');
60
+ expect(
61
+ container.querySelector('div[data-testid="select"] div')
62
+ ).toHaveTextContent('Indices');
63
+ expect(
64
+ container.querySelector('div[data-testid="select"]:nth-child(2) div')
65
+ ).toHaveTextContent('Australia 200');
52
66
  });
53
67
  });
@@ -1,26 +1,37 @@
1
1
  /**
2
2
  * @jest-environment jsdom
3
3
  */
4
- import React from 'react';
5
- import { render } from '@testing-library/react';
6
4
  import { MockedProvider } from '@apollo/client/testing';
7
- import { Size, ThemeContext } from '@oanda/labs-widget-common';
8
- import { ToolWithData } from '../src/ValueAtRiskWidget/ToolWithData';
5
+ import { MockLayoutProvider } from '@oanda/labs-widget-common';
6
+ import { render } from '@testing-library/react';
7
+ import React from 'react';
8
+
9
9
  import { Division } from '../src/gql/types/graphql';
10
- import { getValueAtRiskAssetClassesMock, getValueAtRiskChartMock } from './mocks/responsesMocks';
10
+ import { ToolWithData } from '../src/ValueAtRiskWidget/ToolWithData';
11
+ import {
12
+ getValueAtRiskAssetClassesMock,
13
+ getValueAtRiskChartMock,
14
+ } from './mocks/responsesMocks';
11
15
 
12
16
  describe('Main component', () => {
13
17
  it('should render tool view', async () => {
14
18
  const { findByTestId } = render(
15
- <MockedProvider mocks={[...getValueAtRiskAssetClassesMock, ...getValueAtRiskChartMock()]}>
16
- <ThemeContext.Provider value={{ size: Size.DESKTOP, isDark: false }}>
19
+ <MockedProvider
20
+ mocks={[
21
+ ...getValueAtRiskAssetClassesMock,
22
+ ...getValueAtRiskChartMock(),
23
+ ]}
24
+ >
25
+ <MockLayoutProvider isDark={false}>
17
26
  <ToolWithData division={Division.Oc} />
18
- </ThemeContext.Provider>
19
- </MockedProvider>,
27
+ </MockLayoutProvider>
28
+ </MockedProvider>
20
29
  );
21
30
 
22
31
  expect(await findByTestId('value-at-risk-wrapper')).toBeInTheDocument();
23
32
 
24
- expect(await findByTestId('value-at-risk-tool-wrapper')).toBeInTheDocument();
33
+ expect(
34
+ await findByTestId('value-at-risk-tool-wrapper')
35
+ ).toBeInTheDocument();
25
36
  });
26
37
  });
@@ -1,27 +1,32 @@
1
1
  /**
2
2
  * @jest-environment jsdom
3
3
  */
4
- import React from 'react';
5
- import { render } from '@testing-library/react';
6
- import { ThemeContext, Size } from '@oanda/labs-widget-common';
7
4
  import { MockedProvider } from '@apollo/client/testing';
8
- import { getValueAtRiskChartMock } from './mocks';
9
- import { Division, ValueAtRiskBars, ValueAtRiskDuration } from '../src/gql/types/graphql';
5
+ import { MockLayoutProvider } from '@oanda/labs-widget-common';
6
+ import { render } from '@testing-library/react';
7
+ import React from 'react';
8
+
9
+ import {
10
+ Division,
11
+ ValueAtRiskBars,
12
+ ValueAtRiskDuration,
13
+ } from '../src/gql/types/graphql';
10
14
  import { Widget } from '../src/ValueAtRiskWidget/Widget';
15
+ import { getValueAtRiskChartMock } from './mocks';
11
16
 
12
17
  describe('Widget component', () => {
13
18
  it('should render widget view', () => {
14
19
  const { getByTestId } = render(
15
20
  <MockedProvider mocks={getValueAtRiskChartMock()}>
16
- <ThemeContext.Provider value={{ size: Size.DESKTOP, isDark: true }}>
21
+ <MockLayoutProvider>
17
22
  <Widget
18
- division={Division.Oc}
19
- instrument="AUD_USD"
20
23
  bars={ValueAtRiskBars.C100}
24
+ division={Division.Oc}
21
25
  duration={ValueAtRiskDuration.C1}
26
+ instrument="AUD_USD"
22
27
  />
23
- </ThemeContext.Provider>
24
- </MockedProvider>,
28
+ </MockLayoutProvider>
29
+ </MockedProvider>
25
30
  );
26
31
 
27
32
  expect(getByTestId('value-at-risk-widget-wrapper')).toBeInTheDocument();
@@ -2,7 +2,11 @@ import { getPercentValueByPips } from '../src/ValueAtRiskWidget/components/Chart
2
2
 
3
3
  describe('getPercentValueByPips', () => {
4
4
  it('should return undefined when value is not in range', () => {
5
- const values = [[-80, 10], [-20, 20], [20, 30]];
5
+ const values = [
6
+ [-80, 10],
7
+ [-20, 20],
8
+ [20, 30],
9
+ ];
6
10
 
7
11
  expect(getPercentValueByPips(-100, values)).toEqual(undefined);
8
12
  expect(getPercentValueByPips(20, values)).toEqual(undefined);
@@ -10,14 +14,22 @@ describe('getPercentValueByPips', () => {
10
14
  });
11
15
 
12
16
  it('should return correct value for positive values', () => {
13
- const values = [[10, 4], [20, 6], [30, 8]];
17
+ const values = [
18
+ [10, 4],
19
+ [20, 6],
20
+ [30, 8],
21
+ ];
14
22
 
15
23
  expect(getPercentValueByPips(15, values)).toEqual(5);
16
24
  expect(getPercentValueByPips(20, values)).toEqual(6);
17
25
  expect(getPercentValueByPips(25, values)).toEqual(7);
18
26
  });
19
27
  it('should return correct value for negative values', () => {
20
- const values = [[-30, 4], [-20, 6], [-10, 8]];
28
+ const values = [
29
+ [-30, 4],
30
+ [-20, 6],
31
+ [-10, 8],
32
+ ];
21
33
 
22
34
  expect(getPercentValueByPips(-25, values)).toEqual(5);
23
35
  expect(getPercentValueByPips(-20, values)).toEqual(6);
@@ -111,6 +111,4 @@ const assetClassesMock = [
111
111
  },
112
112
  ];
113
113
 
114
- export {
115
- assetClassesMock,
116
- };
114
+ export { assetClassesMock };
@@ -1,6 +1,10 @@
1
1
  import { getValueAtRiskAssetClasses } from '../../src/gql/getValueAtRiskAssetClasses';
2
2
  import { getValueAtRiskChart } from '../../src/gql/getValueAtRiskChart';
3
- import { Division, ValueAtRiskBars, ValueAtRiskDuration } from '../../src/gql/types/graphql';
3
+ import {
4
+ Division,
5
+ ValueAtRiskBars,
6
+ ValueAtRiskDuration,
7
+ } from '../../src/gql/types/graphql';
4
8
  import { assetClassesMock } from './assetClassesMock';
5
9
  import { valueAtRiskChartMock } from './valueAtRiskChartMock';
6
10
 
@@ -56,6 +60,6 @@ const getValueAtRiskChartErrorMock = [
56
60
 
57
61
  export {
58
62
  getValueAtRiskAssetClassesMock,
59
- getValueAtRiskChartMock,
60
63
  getValueAtRiskChartErrorMock,
64
+ getValueAtRiskChartMock,
61
65
  };
@@ -41,25 +41,32 @@ describe('sortAlphabetically', () => {
41
41
  {
42
42
  displayName: 'AUD/USD',
43
43
  name: 'AUD_USD',
44
- }, {
44
+ },
45
+ {
45
46
  displayName: 'EUR/CZK',
46
47
  name: 'EUR_CZK',
47
- }, {
48
+ },
49
+ {
48
50
  displayName: 'EUR/HKD',
49
51
  name: 'EUR_HKD',
50
- }, {
52
+ },
53
+ {
51
54
  displayName: 'EUR/PLN',
52
55
  name: 'EUR_PLN',
53
- }, {
56
+ },
57
+ {
54
58
  displayName: 'EUR/SGD',
55
59
  name: 'EUR_SGD',
56
- }, {
60
+ },
61
+ {
57
62
  displayName: 'GBP/CHF',
58
63
  name: 'GBP_CHF',
59
- }, {
64
+ },
65
+ {
60
66
  displayName: 'GBP/HKD',
61
67
  name: 'GBP_HKD',
62
- }, {
68
+ },
69
+ {
63
70
  displayName: 'GBP/SGD',
64
71
  name: 'GBP_SGD',
65
72
  },