LuisValgoi / ui5-webcomponents-react-seed

Seed of UI5 Web Components for React
12 stars 1 forks source link

Session Timeout #46

Open isaqueha opened 3 years ago

isaqueha commented 3 years ago

Description

This PR adds the Session Timeout dialog and engine; The Information Dialog is included since it is a dependency.

Testing

  1. Open Application;
  2. Let the application unattended;
  3. Wait for 13 minutes (or change the Constants.js file);
  4. Check that a Warning Popup displays;
  5. Wait for 15 minutes (or change the Constants.js file);
  6. Check that a Timeout Popup displays.

Automated Tests

References

isaqueha commented 3 years ago

@LuisValgoi, I have done some changes, can you review it again?

About the Unit Tests, I could only test the snapshot. That's because the Dialogs are not "open" by default, and the screen.getByTestId can't find them. Any suggestions on what to test in the Unit Tests?

LuisValgoi commented 3 years ago

@isaqueha check my last commits pls?

LuisValgoi commented 3 years ago

@isaqueha another thing:

Wouldn´t be nice for us to like add two black box test to see the sessiontimeout state?

examples:

1st

i should render, wait 15min and see the text as “has expired”

2nd

i should render, wait 13min and see the text as “almost expiring”

lpohren commented 3 years ago

@isaqueha , I removed the snapshot test for the Information Dialog, it was not building the component. It is probably happening because needs the dialog ref, which we cannot use in the test. For the SessionTimeout test, the 'Session expired' test is failing for me and in the CI, I couldn't fix it.

isaqueha commented 3 years ago

Hi @lpohren, The SessionTimeout test is broken in fact, probably it has the same issue with the Information Dialog and the dialog ref. I think we can go without snapshots for these dialogs. What do you think?

lpohren commented 3 years ago

Yes, I agree