Ennovation and Malcolm are right - search engines will see the entire text, as long as the JS is just being used for show/hide (users without JS enabled will see the same thing).
As long as there is an option to show the text (i.e. it's not completely hidden from users), and the text itself isn't keyword-stuffed or spammy, I can't see a reason why search engines would consider it spam.