Category Archives: Programming

Guide on How to Test React Apollo components with Enzyme

Testing React Apollo components with Enzyme

Update on 12 Sept 2018:

React Apollo introduced official documentation on testing in June 2018:

https://www.apollographql.com/docs/guides/testing-react-components.html

You can still read my original post below, which includes Enzyme specific techniques that is not covered in official docs.


Despite its popularity, React Apollo client has no good documentations on how to do testing for React Apollo components with Enzyme.

The only documentation that I found online for testing React Apollo component is a comment from React Apollo team on GitHub, and it is not using Enzyme.

So how do you test React Apollo components with Enzyme? And perhaps more importantly how do you get access to the inner component wrapped by React Apollo as a higher-order component (HOC) to mock its functions and verify its behaviours? Continue reading

Touchpal keyboard alternative with slidedown for symbols - Multiling O

Touchpal keyboard alternative with slide down for symbols – Multiling O

Touchpal keyboard alternative

So you’ve been an Android user for several years and Touchpal keyboard seems to the best Android keyboard out there, with its killer feature – swiping down to input symbols. You can’t live without that feature, but you really hate the annoying ads in Touchpad that was recently introduced. Luckily, I’ve found the near perfect Touchpal keyboard alternative for you – Multiling O Keyboard. Continue reading

reduce macOS Finder memory usage

How to Reduce macOS Finder Memory Usage

If you are experiencing slow performance on memory on macOS (OS X), chances are your memory is running low. While Chrome is notorious for taking up large amount of memory, another culprit is actually the macOS’s own app Finder, which can use up huge amount of RAM. This post will show you how to reduce macOS Finder memory usage from almost a 1GB:

reduce macOS Finder memory usage

Down to a mere 50MB:

Continue reading

A*genda in Angular 2

Developing A*genda in Angular 2

For the final project of CS3216, our team decided to develop a web app A*genda that helps event organizers to build web-based agenda for their events.

A*genda - screenshot of PyCon SG 2016 agenda for event participants

A*genda – screenshot of PyCon SG 2016 public agenda, used by event participants

A*genda - screenshot of agenda builder interface, used by event organizers to create event agenda

A*genda – screenshot of agenda builder interface, used by event organizers to create event agenda

This was an unfortunate timing (October 2016) for our team since Angular 2 just came out of beta, and Angular 1 is going to be the “legacy” framework soon. As a team that has no experience with other frameworks like React.js or vue.js, we were stuck between Angular 1 and Angular 2, and the final decision was latter. Continue reading