Skip to content

Commit

Permalink
fixing and adding tests
Browse files Browse the repository at this point in the history
  • Loading branch information
xoscar committed May 26, 2022
1 parent 2615bb8 commit 24f79d5
Show file tree
Hide file tree
Showing 19 changed files with 360 additions and 152 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ exports[`Layout 1`] = `
/>
</header>
<main
class="ant-layout-content sc-bdvvtL cVXBSg"
class="ant-layout-content sc-bdvvtL ioserY"
>
<h2>
This
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,18 +113,18 @@ exports[`Router 1`] = `
/>
</header>
<main
class="ant-layout-content sc-bdvvtL cVXBSg"
class="ant-layout-content sc-bdvvtL ioserY"
>
<div
class="sc-llYSUQ jPRqiW"
>
<h4
class="ant-typography sc-cxpSdN bbcJQg"
class="ant-typography sc-cxpSdN fwzkuk"
>
All Tests
</h4>
<div
class="sc-iwjdpV NicDQ"
class="sc-iwjdpV CCAvg"
>
<span
class="ant-input-affix-wrapper sc-gWXbKe kPVVws"
Expand Down Expand Up @@ -182,9 +182,6 @@ exports[`Router 1`] = `
data-cy="test-list"
/>
</div>
<div
class="sc-ikJyIC exAstU"
/>
</main>
</div>
`;
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ exports[`Layout 1`] = `
<span
class="ant-typography ant-typography-secondary"
>
HTTP • •
Generalmockspan-mock
</span>
</div>
<div
Expand All @@ -37,38 +37,10 @@ exports[`Layout 1`] = `
>
<div
class="ant-tabs-tab ant-tabs-tab-active"
>
<div
aria-controls="rc-tabs-test-panel-span-request"
aria-selected="true"
class="ant-tabs-tab-btn"
id="rc-tabs-test-tab-span-request"
role="tab"
tabindex="0"
>
Request
</div>
</div>
<div
class="ant-tabs-tab"
>
<div
aria-controls="rc-tabs-test-panel-span-response"
aria-selected="false"
class="ant-tabs-tab-btn"
id="rc-tabs-test-tab-span-response"
role="tab"
tabindex="0"
>
Response
</div>
</div>
<div
class="ant-tabs-tab"
>
<div
aria-controls="rc-tabs-test-panel-span-attribute-list"
aria-selected="false"
aria-selected="true"
class="ant-tabs-tab-btn"
id="rc-tabs-test-tab-span-attribute-list"
role="tab"
Expand Down Expand Up @@ -126,34 +98,80 @@ exports[`Layout 1`] = `
>
<div
aria-hidden="false"
aria-labelledby="rc-tabs-test-tab-span-request"
aria-labelledby="rc-tabs-test-tab-span-attribute-list"
class="ant-tabs-tabpane ant-tabs-tabpane-active"
id="rc-tabs-test-panel-span-request"
id="rc-tabs-test-panel-span-attribute-list"
role="tabpanel"
tabindex="0"
>
<div
class="sc-furwcr bsfqEZ"
/>
>
<div
class="sc-bdvvtL laqDNn"
>
<div
class="sc-hKwDye fzIjgC"
>
<span
class="ant-typography ant-typography-secondary sc-eCImPb kRXiwK"
>
service.name
</span>
</div>
<span
class="ant-typography sc-iCfMLu leaIeI"
>
mock
</span>
<div
class="sc-jRQBWg bHOJVG"
/>
</div>
<div
class="sc-bdvvtL laqDNn"
>
<div
class="sc-hKwDye fzIjgC"
>
<span
class="ant-typography ant-typography-secondary sc-eCImPb kRXiwK"
>
name
</span>
</div>
<span
class="ant-typography sc-iCfMLu leaIeI"
>
span-mock
</span>
<div
class="sc-jRQBWg bHOJVG"
/>
</div>
<div
class="sc-bdvvtL laqDNn"
>
<div
class="sc-hKwDye fzIjgC"
>
<span
class="ant-typography ant-typography-secondary sc-eCImPb kRXiwK"
>
tracetest.span.duration
</span>
</div>
<span
class="ant-typography sc-iCfMLu leaIeI"
>
10
</span>
<div
class="sc-jRQBWg bHOJVG"
/>
</div>
</div>
</div>
<div
aria-hidden="true"
aria-labelledby="rc-tabs-test-tab-span-response"
class="ant-tabs-tabpane"
id="rc-tabs-test-panel-span-response"
role="tabpanel"
style="display: none;"
tabindex="-1"
/>
<div
aria-hidden="true"
aria-labelledby="rc-tabs-test-tab-span-attribute-list"
class="ant-tabs-tabpane"
id="rc-tabs-test-panel-span-attribute-list"
role="tabpanel"
style="display: none;"
tabindex="-1"
/>
</div>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ exports[`TestCardActions 1`] = `
<div>
<span
class="ant-dropdown-trigger ant-dropdown-link"
data-cy="test-actions-button-2309ei30"
data-cy="test-actions-button-e2b2fb7a-1a42-4726-85b3-d35a353b00f0"
>
<span
aria-label="more"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@
exports[`TestCard 1`] = `
<div>
<div
class="sc-iqseJM fscQmy"
class="sc-iqseJM eeBDwy"
>
<div
class="sc-crHmcD dvudNn"
>
<span
aria-label="right"
class="anticon anticon-right"
data-cy="collapse-test"
data-cy="collapse-test-1dc446cf-83c8-4daf-b972-47ad00475d9a"
role="img"
tabindex="-1"
>
Expand All @@ -35,27 +35,23 @@ exports[`TestCard 1`] = `
<span
class="ant-typography sc-hBUSln fEhLhq"
>
Brent
</span>
</div>
<div
class="sc-bqiRlB ghwjXk"
>
<span
class="ant-typography sc-fotOHu"
>
GET
</span>
/>
</div>
<div
class="sc-bqiRlB ghwjXk"
data-cy="test-url-2309ei30"
data-cy="test-url-1dc446cf-83c8-4daf-b972-47ad00475d9a"
>
<span
class="ant-typography sc-fotOHu"
>
</span>
/>
</div>
<div
class="sc-bqiRlB ghwjXk"
Expand All @@ -65,7 +61,7 @@ exports[`TestCard 1`] = `
>
<button
class="ant-btn ant-btn-primary ant-btn-background-ghost"
data-cy="test-run-button-2309ei30"
data-cy="test-run-button-1dc446cf-83c8-4daf-b972-47ad00475d9a"
type="button"
>
<span>
Expand All @@ -75,7 +71,7 @@ exports[`TestCard 1`] = `
</div>
<span
class="ant-dropdown-trigger ant-dropdown-link ant-dropdown-open"
data-cy="test-actions-button-2309ei30"
data-cy="test-actions-button-1dc446cf-83c8-4daf-b972-47ad00475d9a"
>
<span
aria-label="more"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,18 +33,18 @@ exports[`SpanAttributesTable 1`] = `
class="ant-typography sc-hKwDye gXTdui"
data-cy="test-details-name"
>
Josephine
(v
)
</h4>
<span
class="ant-typography ant-typography-secondary sc-eCImPb bTklbz"
>
GET
-
</span>
</div>
<div
class="sc-furwcr kLOQYj"
class="sc-furwcr ePseWR"
data-cy="test-run-result-status"
>
<span
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ exports[`TraceNode 1`] = `
<div>
<div
class="sc-bdvvtL kNAymc"
data-cy="trace-node-http"
data-cy="trace-node-general"
>
<div
class="sc-gsDKAQ cmaxSH"
class="sc-gsDKAQ hcmEDi"
>
<span
class="ant-typography"
>
HTTP
General
</span>
</div>
<div
Expand All @@ -24,11 +24,17 @@ exports[`TraceNode 1`] = `
<div
class="sc-hKwDye etMbsh"
>
<span
class="ant-typography ant-typography-ellipsis ant-typography-single-line ant-typography-ellipsis-single-line sc-dkPtRN dvhzfk"
>
<strong>
mock
</strong>
</span>
<span
class="ant-typography ant-typography-ellipsis ant-typography-single-line ant-typography-ellipsis-single-line sc-dkPtRN dvhzfk"
>
span-mock
</span>
</div>
<div
Expand Down
2 changes: 1 addition & 1 deletion web/src/gateways/__tests__/Test.gateway.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import TestGateway from '../Test.gateway';

const {createTest, getTestById, getTestList, runTest} = endpoints;

jest.mock('../../redux/apis/Test.api', () => {
jest.mock('../../redux/apis/TraceTest.api', () => {
const initiate = jest.fn(() => Promise.resolve());

return {
Expand Down
2 changes: 1 addition & 1 deletion web/src/gateways/__tests__/TestDefinition.gateway.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import TestDefinitionGateway from '../TestDefinition.gateway';

const {setTestDefinition, getTestDefinition} = endpoints;

jest.mock('../../redux/apis/Test.api', () => {
jest.mock('../../redux/apis/TraceTest.api', () => {
const initiate = jest.fn(() => Promise.resolve());

return {
Expand Down
2 changes: 1 addition & 1 deletion web/src/gateways/__tests__/TestRun.gateway.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import TestRunResultGateway from '../TestRun.gateway';

const {getRunList, getRunById, reRun} = endpoints;

jest.mock('../../redux/apis/Test.api', () => {
jest.mock('../../redux/apis/TraceTest.api', () => {
const initiate = jest.fn(() => Promise.resolve());

return {
Expand Down
20 changes: 20 additions & 0 deletions web/src/models/__mocks__/AssertionResults.mock.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import faker from '@faker-js/faker';
import {TAssertionResults, TRawAssertionResults} from '../../types/Assertion.types';
import {IMockFactory} from '../../types/Common.types';
import AssertionResults from '../AssertionResults.model';
import AssertionResultMock from './AssertionResult.mock';

const AssertionResultsMock: IMockFactory<TAssertionResults, TRawAssertionResults> = () => ({
raw(data = {}) {
return {
allPassed: faker.datatype.boolean(),
resultList: new Array(faker.datatype.number({min: 2, max: 10})).fill(null).map(() => AssertionResultMock.raw()),
...data,
};
},
model(data = {}) {
return AssertionResults(this.raw(data));
},
});

export default AssertionResultsMock();
Loading

0 comments on commit 24f79d5

Please sign in to comment.