You just need to use the Team Attack at every chance when the Pokémon you want to evolve is in your party to increase "happiness". It doesn't have to evolve right after a Team Attack. It also helps to use the Pokémon a lot. I would recommend that you just keep it in your party and use Team Attack whenever it's available for it to evolve.
I hope this proves successful for you :)