Skip to content

Commit

Permalink
Merge branch 'master' into fix/mywork
Browse files Browse the repository at this point in the history
  • Loading branch information
tumms2021389 authored Nov 12, 2024
2 parents b247ab0 + 9603d9f commit fb30f66
Show file tree
Hide file tree
Showing 8 changed files with 53 additions and 42 deletions.
60 changes: 31 additions & 29 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
"downloadjs": "^1.4.7",
"fast-deep-equal": "^3.1.3",
"lodash.difference": "^4.5.0",
"material-ui-phone-number": "^3.0.0",
"mui-tel-input": "^6.0.1",
"react": "^17.0.2",
"react-datepicker": "^4.25.0",
"react-dom": "^17.0.2",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { useEffect, useState } from 'react';
import MuiPhoneNumber from 'material-ui-phone-number';
import { MuiTelInput } from 'mui-tel-input';

import { getComponentFromMap } from '../../../bridge/helpers/sdk_component_map';
import { PConnFieldProps } from '../../../types/PConnProps';
Expand Down Expand Up @@ -57,12 +57,12 @@ export default function Phone(props: PhoneProps) {
const disableDropdown = true;
return (
<div>
<MuiPhoneNumber
<MuiTelInput
fullWidth
helperText={helperTextToDisplay}
placeholder={placeholder ?? ''}
size='small'
defaultCountry='us'
defaultCountry='US'
required={required}
disabled={disabled}
onChange={onChange}
Expand Down Expand Up @@ -91,13 +91,13 @@ export default function Phone(props: PhoneProps) {
};

return (
<MuiPhoneNumber
<MuiTelInput
fullWidth
variant='outlined'
helperText={helperTextToDisplay}
placeholder={placeholder ?? ''}
size='small'
defaultCountry='us'
defaultCountry='US'
required={required}
disabled={disabled}
onChange={handleChange}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -165,4 +165,5 @@

.scrollable {
overflow-y: scroll !important;
min-height: 200px !important;
}
Original file line number Diff line number Diff line change
Expand Up @@ -258,11 +258,16 @@ export default function SimpleTableManual(props: PropsWithChildren<SimpleTableMa
function generateRowsData() {
// if referenceList is empty and dataPageName property value exists then make a datapage fetch call and get the list of data.
if (!referenceList.length && dataPageName) {
getDataPage(dataPageName, parameters, context).then(listData => {
const data = formatRowsData(listData);
myRows = data;
setRowData(data);
});
getDataPage(dataPageName, parameters, context)
.then(listData => {
const data = formatRowsData(listData);
myRows = data;
setRowData(data);
})
.catch(e => {
// eslint-disable-next-line no-console
console.log(e);
});
} else {
// The referenceList prop has the JSON data for each row to be displayed
// in the table. So, iterate over referenceList to create the dataRows that
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ test.describe('E2E test', () => {
/** Testing error case by uploading empty file */
await page.setInputFiles(`#AttachmentList`, [zeroBytesFile]);
await expect(page.locator('div >> text="Error with one or more files"')).toBeVisible();
await expect(page.locator(`div >> text="Empty file can't be uploaded."`)).toBeVisible();
await expect(page.locator(`div >> text="Empty file can't be uploaded." >> nth=0`)).toBeVisible();

const errorFile = await page.locator('div[class="psdk-utility-card"]:has-text("Unable to upload file")');
await errorFile.locator('button[aria-label="Delete Attachment"]').click();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ test.describe('E2E test', () => {
/** Required tests */
const requiredEmail = page.locator('input[data-test-id="96fa7548c363cdd5adb29c2c2749e436"]');
requiredEmail.fill('[email protected]');
requiredEmail.blur();
await expect(page.locator('p.Mui-error.Mui-required')).toBeHidden();

/** Checking 'field label', 'placeholder', and 'helper text' */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,14 +99,16 @@ test.describe('E2E test', () => {
const validationMsg = 'Enter a valid phone number';
await editablePhoneInput.clear();
await countrySelector.click();
await page.locator('text=United States+1 >> nth=0').click();
await page.locator('text=United Kingdom+44 >> nth=0').click();
/** Entering an invalid Phone number */
await common.enterPhoneNumber(editablePhone, '61');
await editablePhoneInput.blur();
/** Expecting an error for Invalid phone number */

await expect(page.locator(`p:has-text("${validationMsg}")`)).toBeVisible();

/** Entering a valid Phone number */
await editablePhoneInput.click();
await editablePhoneInput.clear();
await countrySelector.click();
await page.locator('text=United States+1 >> nth=0').click();
Expand Down

0 comments on commit fb30f66

Please sign in to comment.