Questions tagged [user-event]

Questions about testing events with the user-event utility.

65 questions
0
votes
1 answer

Testing Library's `user-event` button click event must be called twice to get the same results as with one `fireEvent` click

I have a form created with React Hook Form that has a required text input field and a submit button. If the user doesn't enter a value to the field before submitting the form, an error message (from formState: { errors } of RHF's useForm hook) is…
MJV
  • 1,782
  • 2
  • 21
  • 33
0
votes
0 answers

Accessing the Unit Cost field using a userevent script

On the sublist on my proposal, i have 2 lines with specific items on them that I need the script to look for and update the unit cost based on a certain percentage of a custom field on the header level. Not sure where my script is messing up. /** …
0
votes
1 answer

Looking for Scripting Help on accessing the billaddresslist

I have a script that "should" Get the customer ID from a created customer field on my form Load the customer record Remove options that are already in the 'billaddresslist' Search for addresses associated with my selected customer add each address…
0
votes
1 answer

How to get the right execution context during runtime

I'm trying to prevent a userevent script from running in case of a mass update triggering it. Pretty simple task you might think. Usually the runtime.executionContext should give me the value that I'm looking for. What I'm expecting is…
DomMa
  • 153
  • 1
  • 11
0
votes
1 answer

How to avoid SSS_REQUEST_TIME_EXCEEDED on HTTPS.post

I have a user event script which executes on create of sales order and sends a HTTPS POST to our integration URL on Mulesoft. It seems NetSuite throws SSS_REQUEST_TIME_EXCEEDED error within 45 secs even if API call was successful. if there a way to…
0
votes
0 answers

Is it possible with Storybook interaction tests to assert the "clickability" of an element that's underneath another DOM element?

I have a React component that conditionally renders a
over the entire screen using position: fixed and a high z-index, making it so that any DOM elements underneath the div can't be interacted with. This is similar behavior to what you would…
0
votes
0 answers

React testing library userEvent.type not updating TextField value

I have a custom React component which underneath returns a textField component from the Mui library. if (type === DynamicFieldType.STRING) { return (
0
votes
1 answer

Netsuite User event script trigger before totaltax is written

I created an user event script to get taxtotal for sales order from AfterSubmit, but I am getting blank value from it. It's not processed before I receive the data, is there a way to await for the value? async function afterSubmit(context) { …
0
votes
1 answer

How to auto select trans line field sourced from vendor and item

I need to add a check in purchase order whether the item has any minimum order qty (moq) set by the vendor. If yes make sure order qty input is more than OR equal to moq if not prompt error to user. I created a custom record "Item Vendor Setting" to…
Mingo
  • 58
  • 5
0
votes
1 answer

How to distinguish user event from code event in Angular MatTabChangeEvent

I have a page need to set target mat tab after API is called. And I need to save tab selection when user change it. But in the event handler, I have no way to distinguish user event from code event: Template:
Justin
  • 1,050
  • 11
  • 26
0
votes
0 answers

how to create unit test for function click on button

how to create unit test for function click on button like this i want hit the function onClickAsCard and onClickAsList , value of view is boolean from context, how i can render button with value view true or false
0
votes
0 answers

SuiteScript - Unexpected Error Record.Save()

For some reason, I am receiving an error when caseRecord.save() is executed. I am unaware if I have missed something but I have looked over this multiple times and can't seem to figure out why I am unable to save the newly created record. Basically,…
0
votes
1 answer

React Testing Library works on HTML elements but not with React components

Basically, I'm trying to test a component that have a select. When trying to test the component, the test fails by returning the default value instead of the changed value. But when I take the HTML of the rendered component (from screen.debug()) it…
0
votes
1 answer

How do you tab between elements in react-modal using user-event?

When writing a test using @testing-library/react and @testing-library/user-event, I am unable to get userEvent.tab() to work inside of the React Modal component. I think it may have something to do with passing the correct focusTrap argument to the…
0
votes
1 answer

Record not creating when importing csv in suitescript

I have a suitescript that is supposed to check a box and then create journal entries when new invoices are created or old ones are updated. However, when importing a csv with the invoices that I want to update it only checks the box but does not…