Skip to content

Commit

Permalink
Fix input number and some tests
Browse files Browse the repository at this point in the history
  • Loading branch information
akucharska committed Oct 24, 2023
1 parent e1a5d2f commit 83dd5c2
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 12 deletions.
2 changes: 1 addition & 1 deletion src/shared/ResourceForm/inputs/Number.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export function Number({ value = '', setValue, ...props }) {
<Input
type="Number"
value={value}
onInput={e => setValue(e.target.valueAsNumber ?? null)}
onInput={e => setValue(e.target.value ?? null)}
{...props}
/>
</div>
Expand Down
8 changes: 6 additions & 2 deletions tests/integration/tests/namespace/test-config-maps.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@ context('Test Config Maps', () => {
.type(CONFIG_MAP_NAME)
.click();

cy.get('[placeholder="Enter key"]:visible').type(ENTRY_KEY);
cy.get('[placeholder="Enter key"]:visible')
.find('input')
.type(ENTRY_KEY);

cy.findMonaco()
.first()
Expand All @@ -53,7 +55,9 @@ context('Test Config Maps', () => {
// hide first entry so Cypress doesn't get confuused
cy.get('[aria-label="expand config-map-key"]').click();

cy.get('[placeholder="Enter key"]:visible').type(ENTRY_KEY2);
cy.get('[placeholder="Enter key"]:visible')
.find('input')
.type(ENTRY_KEY2);

cy.findMonaco(1).type(ENTRY_VALUE2);

Expand Down
15 changes: 15 additions & 0 deletions tests/integration/tests/namespace/test-cron-jobs.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,28 +23,37 @@ context('Test Cron Jobs', () => {
.type(CRON_JOB_NAME);

cy.get('[placeholder="Minute"]')
.find('input')
.clear()
.type(0);

cy.get('[placeholder="Hour"]')
.find('input')
.clear()
.type(0);

cy.get('[placeholder="Day of Month"]')
.find('input')
.clear()
.type(1);

cy.get('[placeholder="Month"]')
.find('input')
.clear()
.type('*');

cy.get('[placeholder="Day of Week"]')
.find('input')
.clear()
.type('*');
cy.get(
'[aria-label="expand Schedule: At 12:00 AM, on day 1 of the month"]',
).click();

cy.contains('Command').click();

cy.get('[placeholder="Command to run in a container"]')
.find('input')
.clear()
.type('ls -la');

Expand All @@ -56,6 +65,7 @@ context('Test Cron Jobs', () => {
cy.get(
'[placeholder="Enter the Docker image tag, for example, \'busybox\'"]',
)
.find('input')
.clear()
.type('busybox');

Expand Down Expand Up @@ -90,20 +100,24 @@ context('Test Cron Jobs', () => {
.click();

cy.get('[placeholder="Hour"]')
.find('input')
.clear()
.type('*');

cy.get('[placeholder="Day of Month"]')
.find('input')
.clear()
.type('*');

cy.get('[placeholder="Month"]')
.find('input')
.clear()
.type('*');

cy.get('[aria-label="expand Command"]').click();

cy.get('[placeholder="Command to run in a container"]')
.find('input')
.clear()
.type('ls');

Expand All @@ -115,6 +129,7 @@ context('Test Cron Jobs', () => {
cy.get(
'[placeholder="Enter the Docker image tag, for example, \'busybox\'"]',
)
.find('input')
.clear()
.type('busytest');

Expand Down
26 changes: 17 additions & 9 deletions tests/integration/tests/namespace/test-deployments.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,48 +27,54 @@ context('Test Deployments', () => {
cy.get('[aria-label="expand Labels"]').click();

cy.get('[placeholder="Enter key"]:visible')
.find('input')
.filterWithNoValue()
.type('app');

cy.get('[placeholder="Enter value"]:visible')
.find('input')
.filterWithNoValue()
.first()
.type(DEPLOYMENT_NAME);

cy.get('[placeholder="Enter key"]:visible')
.find('input')
.filterWithNoValue()
.type('example');

cy.get('[placeholder="Enter value"]:visible')
.find('input')
.filterWithNoValue()
.first()
.type(DEPLOYMENT_NAME);

cy.get('[placeholder^="Enter the Docker image"]:visible').type(
DOCKER_IMAGE,
);
cy.get('[placeholder^="Enter the Docker image"]:visible')
.find('input')
.type(DOCKER_IMAGE);

cy.contains('Advanced').click();

cy.contains('label', 'Memory Requests')
cy.contains('ui5-label', 'Memory Requests')
.next()
.find('input.fd-input')
.find('ui5-input')
.find('input')
.clear()
.type('32');

cy.contains('label', 'Memory Limits')
cy.contains('ui5-label', 'Memory Limits')
.next()
.find('input.fd-input')
.find('ui5-input')
.find('input')
.clear()
.type('64');

cy.contains('label', 'CPU Requests (m)')
cy.contains('ui5-label', 'CPU Requests (m)')
.next()
.find('input')
.clear()
.type('10');

cy.contains('label', 'CPU Limits (m)')
cy.contains('ui5-label', 'CPU Limits (m)')
.next()
.find('input')
.clear()
Expand Down Expand Up @@ -111,10 +117,12 @@ context('Test Deployments', () => {
cy.get('[aria-label="expand Labels"]').click();

cy.get('[placeholder="Enter key"]:visible')
.find('input')
.filterWithNoValue()
.type('label-key');

cy.get('[placeholder="Enter value"]:visible')
.find('input')
.filterWithNoValue()
.first()
.type('label-value');
Expand Down

0 comments on commit 83dd5c2

Please sign in to comment.