In one application I am working on we have some links that will trigger some tracking events:
<a href="/foo" data-track='{type: "navigation"}'>Go to Foo</a>
<script>
$(document).ready(function () {
$('data-track').click(function (e) {
var data = $(this).data('track');
// how to test this on an acceptance test?
appTracking.track(data);
});
});
</script>
The question is:
- Is it possibe to make sure tracking is working on acceptance tests?
Or perhaps acceptance tests are not supposed to test this stuff. I would like to hear your thoughts.
We do have unit tests for that behaviour, but we want to ensure that we wired everything correctly.
I am not sure the answer is testing framework specific, but we are using Codeception for acceptance tests.
Thank you in advance.