Files
edx-platform/lms/static/js/spec/feedback_form_spec.js
Michael Terry a34c8c8233 Drop remaining coffee use
This basically commits the transpiled CoffeeScript JS (with minor
cleanup) and removes coffee build support.

A tiny amount of support for xblocks exists, because external users
may have xblocks with coffee. But no coffee in our tree anyway.
2018-04-13 14:10:40 -04:00

29 lines
944 B
JavaScript

describe('FeedbackForm', function() {
beforeEach(() => loadFixtures('coffee/fixtures/feedback_form.html'));
describe('constructor', function() {
beforeEach(function() {
new FeedbackForm;
spyOn($, 'postWithPrefix').and.callFake((url, data, callback, format) => callback());
});
it('post data to /send_feedback on click', function() {
$('#feedback_subject').val('Awesome!');
$('#feedback_message').val('This site is really good.');
$('#feedback_button').click();
expect($.postWithPrefix).toHaveBeenCalledWith('/send_feedback', {
subject: 'Awesome!',
message: 'This site is really good.',
url: window.location.href
}, jasmine.any(Function), 'json');
});
it('replace the form with a thank you message', function() {
$('#feedback_button').click();
expect($('#feedback_div').html()).toEqual('Feedback submitted. Thank you');
});
});
});