its a bit murky and honestly i am not sure you will ever get a straight answer without trying it (and possibly losing access to all your games). nintendo is NOT a portable digital world, if your wii u or 3ds were broken and you bought a new one logging in with your nintendo network id will not give you any of your eshop purchases on your new system. you have to call into nintendo and have them transfer all your games to your new console, which takes them 1-7 days.
in the past people have reported they have done a factory wipe on a wii u, sold it to someone, that person has created a new (or used an existing) nintendo network id, and had all the games previously bought on that wii u available to them. that was last year. they have been trying to muck around with nintendo network id, club nintendo, eshop, etc this year merging them all so who really knows what the current state is.