Profile
Achievement
You have not received any achievements.heathbo's Recent Snippets
« Prev 1 Next »
How to pass a parameter into a method from an onClick method found in the render method.
Majority of the times when you need to do this, your adding it through a loop. In this case, call a function where the item in the loop will automatically be...
0
1216
posted 7 years ago by heathbo
Use ref with getDOMNode() to get the actual html.
Using getBoundingClientRect() on the actual html will give you the width, height, etc.
Below:
specs = ClientRect {} bottom: 269 height: 18 left: 797.546875 right: 1062.609375 top: 251 width: 2...
0
1529
posted 8 years ago by heathbo
Within a react component. How to gain access to the HTML that was just rendered.
Any returned html element that is tagged with a ref, can easily be accessed by it's ref after it's been rendered. In the below case, use this.refs["domainModal"] to...
0
1047
posted 8 years ago by heathbo
This is code you put in a CSS file. It queries the size of the screen using the parameters passed in. If its true, it then applies the CSS
0
1083
posted 9 years ago by heathbo
The code to verify that a method was called.
The this.mockProvider.Verify verifies that GetBiAutoProcessConfigByKeys is called.
0
1013
posted 10 years ago by heathbo
The ExpectedException section under [TestMethod] is where you tell Moq what type of exception your listening for. If that exception is thrown, then this test will pass and it will stop running all the code under the target.CalculateProvisionalPrice....
0
1673
posted 10 years ago by heathbo
Example 1: I'm verifying that the list that is passed in has 3 attachments. SendMail is run later in the SendEmail method.
Example 2: I'm verifying that the object that is passed into the method has the appropriate values.
0
1333
posted 10 years ago by heathbo