React day picker doesn't update class name after simulating click event through enzyme - enzyme

I'm using React day picker and trying to write some tests for it. One of the tests includes simulating click on a particular day and then checking the class name of that day whether it has added the selected class to it or not. But the problem is, the class name doesn't change at all even after simulating click through enzyme's method simulate('click'). The on click handler does get called though, and I can see in the console output which day was clicked.

Figured out! The problem was I was checking the resultant html for the updated class name using the debug() method. But I realised that by using html() I could get the latest updated result. However, for actually checking the existence of the selected class, I couldn't simply use hasClass(<className>), instead I had to use .render().hasClass(<className>).
In short, the click event was working as expected, but just that the checking out output had to be done differently.

Related

Trying to add link on d365 model driven app to show all items in a specific queue

I am working in Dynamics 365 online and working inside a model driven app, I'm adding a link on the left side navigation that takes them to a page displaying all items within a specific queue.
However I can only seem to take them to a page that shows All Items I Am Working on, and under that Queues I'm a member of.
No one is a member of any queue since they are public. I just want a simple way to show them all of the queue items inside a specific queue once they click "Physical Mail".
I tried creating a specific view, but since the queue item filter defaults to "Queues I'm a member of" this doesn't work for me.
Is what I am wanting to do possible?
It's very straightforward: when looking at the specific view that you want, copy the URL from the address bar and put it in the Sitemap as "URL" instead of "Entity".
(If the view that you want does not exist, you'll have to first of all create it, of course).

Document has been modified or corrupted since signed! (data)

I'm working in HCL Notes application. I have developed a summary view to show calculated figures to the user. Then the user clicks one of the action buttons and I open a detailed view, but for that view I setup Selection Formula on the fly so that it shows the records filtered specific to that button conditions. It was working almost fine for a few days, but now most of the time it shows some previously shown (filtered) data no matter what button the user has clicked. Means it doesn't set the Selection Formula of the view and shows the view with the old formula and it won't get back to normal condition even if they restart Notes application.
When the user is stuck in this particular condition, and they peep through the status bar it shows this message:
Document has been modified or corrupted since signed! (data).
The necessary code-snippet is as below:
*Set dtlView = db.GetView("Report_Dtl")
dtlView.SelectionFormula =formula
Call dtlView.Refresh()*
where formula is the dynamically built formula. Looks like the line
dtlView.SelectionFormula =formula
is unable to update the selection formula and then the line below generates the above error message:
Call uidb.OpenView(dtlView.Name,,False, False)
Please help!
Thanks
For "on the fly" modification of the view selection formula your user need "Designer"- access to the database, and that is never a good idea. The help document to the function you are using is explicitly stating that this is not a good idea (emphasise of mine):
This is not a good way to display a selected set of documents for a specific user. When you use this property to change the view selection, it applies to all users of the view.
There are problems with using this method to make a view display a new selection of documents for an end user:
Do not give end-users Designer access to an application.
If it is a shared view, users will interfere with each other's searches.
The NotesĀ® client caches design information, and there's no way to tell it to update its cache (except for outlines). Exiting and re-entering the application usually works, but it's hard to programmatically ensure the user exited the application entirely.
In addition the modification of the view selection formula can break the signature of the design element and then other errors occur.
Better use another approach:
Use a Folder for every user and put the selected documents in there (after doing a NotesDatabase.Search with the formula
Use a separate view for every user and let a server agent manipulate its selection formula with a user that has access.
For having a separate view / folder for every user you could use "Shared, Private on first use"- views (they are not easy to maintain), or any process that generates them and is able to assign every view to the users they belong to... in both cases this needs some effort, but at least it will work.

Joomla 3.8 switching templates/styles?

Okay, so I understand that you can set a template/style in a menu item which I understand. However.. What would you do in this situation..
The website uses two different templates/styles depending on what section of the website they are in.
What if you are in section 1 of the website and need to go to section 2 that uses a different style? And this action is controlled by a controller on if a condition is met.
I've managed to do this so far using $app->redirect and including the Menu Id so that joomla picks up the correct template/style to use. However this just seems wrong, as I can't determine the Menu Id once the component is installed elsewhere...
Doing the getView() approach to show a certain view seems like the correct procedure, however it doesn't allow me to change the template/style and will use the template/style from the original menu item.
Is there another method I don't know about? Does Joomla simply not have something in place for this? It's almost as if I need to change getView to accept a template/style parameter
They changed the name Template/Style to theme.
JFactory::getApplication()->set('theme', 'my_system');

No result with SendKeys to IE8 using Selenium on BrowserStack

I'm using Selenium to perform testing on BrowserStack, and have hit a problem while testing IE8.
I've found that when I target elements and then call Click, the full effect of the action is not being undertaken*.
Through trial-and-error I found that if I call Click twice then the expected action is undertaken.
However, one of the testing steps involves writing a number to a text field, and for this I have the following:
driver.FindElement(By.CssSelector("...")).Click();
driver.FindElement(By.CssSelector("...")).Clear();
driver.FindElement(By.CssSelector("...")).SendKeys(Keys.NumberPad1);
driver.FindElement(By.CssSelector("...")).Click();
But "1" never appears in the field. I can tell it never appears because I'm capturing screenshots after each step; I can see that the field gets highlighted (as the active element) and I can see the cursor inside the field, but no result from the method call.
Furthermore, I've even tried giving the field an ID and addressing it with
driver.FindElement(By.Id("txtCountManual")).SendKeys(Keys.NumberPad1);
But with the same (lack of) results.
Does anyone have any suggestions as to how I may send a textual value to a field in IE8 using Selenium and BrowserStack?
* The "expected action" involves using Knockout.js to display a selected value in another element. So for example, I found that if I programmatically click a radio button and then take a screenshot, I can see that the radio button has been clicked but the action performed by Knockout.js has not taken place; if I click the element a second time then the Knockout.js action is performed. This double-clicking is not required when I manually test using IE8 via BrowserStack.

Cancel edit in QTableView when delegate loses focus

I am using a basic QTableView + QAbstractTableModel architecture.
Data can be edited via a QAbstractItemDelegate subclass. Everything works as expected but I need to slightly change the editing behaviour:
Qt default behaviour is:
For an open delegate editor, hitting Enter confirms the edit
For an open delegate editor, hitting Escape cancels the edit
For an open delegate editor, clicking in a different table view cell confirms the edit
I want to get rid of the last one. If the delegate editor loses focus, the edit shall be canceled (i. e. it shall not emit editingFinished()) so that a user can only submit changes by pressing Enter.
Is there a convenient way to do this?
Thanks in advance
Override the class, find out which function that last behaviour is that you dont want, then override that function and just leave the implementation of it empty, then it gets called just as it would usually but now it does nothing (or does something else, you're programming it make it do whatever you want)
I would override the QAbstractItemModel::setData() in your model and skip emitting dataChanged() on attempt to set the same data as it is already existing for the given item.