Eğer doğru anladıysam

$('.test-btn').on('click', function(
yerine

$(document).on('click', '.test-btn', function(
olacaktır.