Skip to content

Commit 595298d

Browse files
add test
1 parent 51c0758 commit 595298d

File tree

4 files changed

+82
-0
lines changed

4 files changed

+82
-0
lines changed

redisinsight/ui/src/pages/browser/modules/key-details/components/rejson-details/components/edit-entire-item-action/EditEntireItemAction.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ const EditEntireItemAction = (props: Props) => {
8383
aria-label="Cancel add"
8484
className={styles.declineBtn}
8585
onClick={onCancel}
86+
data-testid="cancel-edit-btn"
8687
/>
8788
<EuiButtonIcon
8889
iconSize="m"

tests/e2e/pageObjects/browser-page.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ export class BrowserPage extends InstancePage {
5757
sortingButton = Selector('[data-testid=header-sorting-button]');
5858
editJsonObjectButton = Selector('[data-testid=edit-json-field]');
5959
applyEditButton = Selector('[data-testid=apply-edit-btn]');
60+
cancelEditButton = Selector('[data-testid=cancel-edit-btn]');
6061
scanMoreButton = Selector('[data-testid=scan-more]');
6162
resizeBtnKeyList = Selector('[data-test-subj=resize-btn-keyList-keyDetails]');
6263
treeViewButton = Selector('[data-testid=view-type-list-btn]');
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
{
2+
"result": [
3+
{
4+
"message": 1234567899876543211111111,
5+
"phoneNumber": "(870) 933-5398 x28029",
6+
"phoneVariation": "+90 363 988 10 51",
7+
"status": "disabled",
8+
"name": {
9+
"first": "Hudson",
10+
"middle": "Marlowe",
11+
"last": "Romaguera"
12+
},
13+
"username": "Hudson-Romaguera",
14+
"password": "15dmjQlqS2ZBhVq",
15+
"emails": [
16+
17+
18+
],
19+
"location": {
20+
"street": "9109 2nd Avenue",
21+
"city": "Howeview",
22+
"state": "North Dakota",
23+
"country": "Saint Helena",
24+
"zip": "62862-7589",
25+
"coordinates": {
26+
"latitude": "81.1514",
27+
"longitude": "-134.2206"
28+
}
29+
},
30+
"website": "https://skinny-barn.info",
31+
"domain": "responsible-notebook.net",
32+
"job": {
33+
"title": "Internal Solutions Officer",
34+
"descriptor": "Principal",
35+
"area": "Branding",
36+
"type": "Developer",
37+
"company": "Shields Group"
38+
},
39+
"creditCard": {
40+
"number": "3409-218740-43272",
41+
"cvv": "909",
42+
"issuer": "visa"
43+
},
44+
"uuid": "91d6042d-8453-440f-9bf1-7412fee085ee",
45+
"objectId": 123456789987654321
46+
}
47+
]
48+
}

tests/e2e/tests/web/regression/browser/add-keys.e2e.ts

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,15 @@ import { commonUrl, ossStandaloneBigConfig, ossStandaloneConfig } from '../../..
55
import { DatabaseAPIRequests } from '../../../../helpers/api/api-database';
66
import { Common } from '../../../../helpers/common';
77
import { BrowserActions } from '../../../../common-actions/browser-actions';
8+
import path from 'path';
89

910
const browserPage = new BrowserPage();
1011
const browserActions = new BrowserActions();
1112
const databaseHelper = new DatabaseHelper();
1213
const databaseAPIRequests = new DatabaseAPIRequests();
1314

15+
const jsonFilePath = path.join('..', '..', '..', '..', 'test-data', 'big-json', 'json-BigInt.json');
16+
1417
const jsonKeys = [['JSON-string', '"test"'], ['JSON-number', '782364'], ['JSON-boolean', 'true'], ['JSON-null', 'null'], ['JSON-array', '[1, 2, 3]']];
1518
let keyNames: string[];
1619
let indexName: string;
@@ -105,3 +108,32 @@ test
105108
// Verify that the new key is not displayed at the top for the Search capability
106109
await browserActions.verifyKeyIsNotDisplayedTop(keyName3);
107110
});
111+
test('Verify that user can add json with BigInt', async t => {
112+
const keyName = Common.generateWord(12);
113+
114+
// Add Json key with json object
115+
await t.click(browserPage.plusAddKeyButton);
116+
await t.click(browserPage.keyTypeDropDown);
117+
await t.click(browserPage.jsonOption);
118+
await t.click(browserPage.addKeyNameInput);
119+
await t.typeText(browserPage.addKeyNameInput, keyName, { replace: true, paste: true });
120+
await t.setFilesToUpload(browserPage.jsonUploadInput, [jsonFilePath]);
121+
await t.click(browserPage.addKeyButton);
122+
123+
await t.click(browserPage.editJsonObjectButton);
124+
await t.expect(await browserPage.jsonValueInput.textContent).contains('result', 'edit value is empty');
125+
await t.click(browserPage.cancelEditButton);
126+
127+
await t.click(browserPage.expandJsonObject);
128+
await t.click(browserPage.expandJsonObject);
129+
await t.expect(await browserPage.jsonKeyValue.textContent).contains('1.2345678998765432e+24', 'BigInt is not displayed');
130+
await t.expect(await browserPage.jsonKeyValue.textContent).contains('123456789987654321', 'BigInt is not displayed');
131+
132+
await browserPage.addJsonKeyOnTheSameLevel('"key2"', '7777777777888889455');
133+
await t.expect(await browserPage.jsonKeyValue.textContent).contains('7777777777888889455', 'BigInt is not displayed');
134+
135+
await t.click(browserPage.editJsonObjectButton.nth(3));
136+
await t.typeText(browserPage.jsonValueInput, '121212121111112121212111', { paste: true, replace: true });
137+
await t.click(browserPage.applyEditButton);
138+
await t.expect(await browserPage.jsonKeyValue.textContent).contains('1.2121212111111212e+23', 'BigInt is not displayed');
139+
});

0 commit comments

Comments
 (0)