Commit dda33bd7 authored by Stan Hu's avatar Stan Hu

Rename JavaScript click -> click() to make karma tests pass

parent 4a4aae7f
...@@ -168,7 +168,7 @@ describe('IntegrationSettingsForm', () => { ...@@ -168,7 +168,7 @@ describe('IntegrationSettingsForm', () => {
expect($flashAction).toBeDefined(); expect($flashAction).toBeDefined();
spyOn(integrationSettingsForm.$form, 'submit'); spyOn(integrationSettingsForm.$form, 'submit');
$flashAction.click; $flashAction.click();
expect(integrationSettingsForm.$form.submit).toHaveBeenCalled(); expect(integrationSettingsForm.$form.submit).toHaveBeenCalled();
}); });
......
...@@ -128,7 +128,7 @@ describe('Issue', function() { ...@@ -128,7 +128,7 @@ describe('Issue', function() {
}); });
it(`${action}s the issue`, function() { it(`${action}s the issue`, function() {
this.$triggeredButton.click; this.$triggeredButton.click();
this.issueStateDeferred.resolve({ this.issueStateDeferred.resolve({
id: 34 id: 34
}); });
...@@ -143,7 +143,7 @@ describe('Issue', function() { ...@@ -143,7 +143,7 @@ describe('Issue', function() {
}); });
it(`fails to ${action} the issue if saved:false`, function() { it(`fails to ${action} the issue if saved:false`, function() {
this.$triggeredButton.click; this.$triggeredButton.click();
this.issueStateDeferred.resolve({ this.issueStateDeferred.resolve({
saved: false saved: false
}); });
...@@ -159,7 +159,7 @@ describe('Issue', function() { ...@@ -159,7 +159,7 @@ describe('Issue', function() {
}); });
it(`fails to ${action} the issue if HTTP error occurs`, function() { it(`fails to ${action} the issue if HTTP error occurs`, function() {
this.$triggeredButton.click; this.$triggeredButton.click();
this.issueStateDeferred.reject(); this.issueStateDeferred.reject();
this.canCreateBranchDeferred.resolve({ this.canCreateBranchDeferred.resolve({
can_create_branch: isIssueInitiallyOpen can_create_branch: isIssueInitiallyOpen
...@@ -173,7 +173,7 @@ describe('Issue', function() { ...@@ -173,7 +173,7 @@ describe('Issue', function() {
}); });
it('disables the new branch button if Ajax call fails', function() { it('disables the new branch button if Ajax call fails', function() {
this.$triggeredButton.click; this.$triggeredButton.click();
this.issueStateDeferred.reject(); this.issueStateDeferred.reject();
this.canCreateBranchDeferred.reject(); this.canCreateBranchDeferred.reject();
...@@ -184,7 +184,7 @@ describe('Issue', function() { ...@@ -184,7 +184,7 @@ describe('Issue', function() {
Issue.$btnNewBranch = $(); Issue.$btnNewBranch = $();
this.canCreateBranchDeferred = null; this.canCreateBranchDeferred = null;
this.$triggeredButton.click; this.$triggeredButton.click();
this.issueStateDeferred.reject(); this.issueStateDeferred.reject();
}); });
}); });
......
...@@ -84,7 +84,7 @@ describe('Merge request notes', () => { ...@@ -84,7 +84,7 @@ describe('Merge request notes', () => {
spyOnEvent('.note:last .js-note-edit', 'click'); spyOnEvent('.note:last .js-note-edit', 'click');
$('.js-discussion-reply-button').click; $('.js-discussion-reply-button').click();
setTimeout(() => { setTimeout(() => {
$('.js-note-text').trigger(upArrowEvent); $('.js-note-text').trigger(upArrowEvent);
......
...@@ -92,7 +92,7 @@ describe('Pipeline Variable List', () => { ...@@ -92,7 +92,7 @@ describe('Pipeline Variable List', () => {
}); });
it('should remove the row when clicking the remove button', () => { it('should remove the row when clicking the remove button', () => {
$markup.find('.js-row-remove-button').click; $markup.find('.js-row-remove-button').click();
expect($markup.find('.js-row').length).toBe(0); expect($markup.find('.js-row').length).toBe(0);
}); });
......
...@@ -44,7 +44,7 @@ import './mock_u2f_device'; ...@@ -44,7 +44,7 @@ import './mock_u2f_device';
it("displays an error message", function() { it("displays an error message", function() {
var errorMessage, setupButton; var errorMessage, setupButton;
setupButton = this.container.find("#js-login-u2f-device"); setupButton = this.container.find("#js-login-u2f-device");
setupButton.click; setupButton.click();
this.u2fDevice.respondToAuthenticateRequest({ this.u2fDevice.respondToAuthenticateRequest({
errorCode: "error!" errorCode: "error!"
}); });
...@@ -54,14 +54,14 @@ import './mock_u2f_device'; ...@@ -54,14 +54,14 @@ import './mock_u2f_device';
return it("allows retrying authentication after an error", function() { return it("allows retrying authentication after an error", function() {
var retryButton, setupButton; var retryButton, setupButton;
setupButton = this.container.find("#js-login-u2f-device"); setupButton = this.container.find("#js-login-u2f-device");
setupButton.click; setupButton.click();
this.u2fDevice.respondToAuthenticateRequest({ this.u2fDevice.respondToAuthenticateRequest({
errorCode: "error!" errorCode: "error!"
}); });
retryButton = this.container.find("#js-u2f-try-again"); retryButton = this.container.find("#js-u2f-try-again");
retryButton.click; retryButton.click();
setupButton = this.container.find("#js-login-u2f-device"); setupButton = this.container.find("#js-login-u2f-device");
setupButton.click; setupButton.click();
this.u2fDevice.respondToAuthenticateRequest({ this.u2fDevice.respondToAuthenticateRequest({
deviceData: "this is data from the device" deviceData: "this is data from the device"
}); });
......
...@@ -23,7 +23,7 @@ import './mock_u2f_device'; ...@@ -23,7 +23,7 @@ import './mock_u2f_device';
var deviceResponse, inProgressMessage, registeredMessage, setupButton; var deviceResponse, inProgressMessage, registeredMessage, setupButton;
setupButton = this.container.find("#js-setup-u2f-device"); setupButton = this.container.find("#js-setup-u2f-device");
expect(setupButton.text()).toBe('Setup new U2F device'); expect(setupButton.text()).toBe('Setup new U2F device');
setupButton.click; setupButton.click();
inProgressMessage = this.container.children("p"); inProgressMessage = this.container.children("p");
expect(inProgressMessage.text()).toContain("Trying to communicate with your device"); expect(inProgressMessage.text()).toContain("Trying to communicate with your device");
this.u2fDevice.respondToRegisterRequest({ this.u2fDevice.respondToRegisterRequest({
...@@ -38,7 +38,7 @@ import './mock_u2f_device'; ...@@ -38,7 +38,7 @@ import './mock_u2f_device';
it("doesn't allow the same device to be registered twice (for the same user", function() { it("doesn't allow the same device to be registered twice (for the same user", function() {
var errorMessage, setupButton; var errorMessage, setupButton;
setupButton = this.container.find("#js-setup-u2f-device"); setupButton = this.container.find("#js-setup-u2f-device");
setupButton.click; setupButton.click();
this.u2fDevice.respondToRegisterRequest({ this.u2fDevice.respondToRegisterRequest({
errorCode: 4 errorCode: 4
}); });
...@@ -48,7 +48,7 @@ import './mock_u2f_device'; ...@@ -48,7 +48,7 @@ import './mock_u2f_device';
it("displays an error message for other errors", function() { it("displays an error message for other errors", function() {
var errorMessage, setupButton; var errorMessage, setupButton;
setupButton = this.container.find("#js-setup-u2f-device"); setupButton = this.container.find("#js-setup-u2f-device");
setupButton.click; setupButton.click();
this.u2fDevice.respondToRegisterRequest({ this.u2fDevice.respondToRegisterRequest({
errorCode: "error!" errorCode: "error!"
}); });
...@@ -58,14 +58,14 @@ import './mock_u2f_device'; ...@@ -58,14 +58,14 @@ import './mock_u2f_device';
return it("allows retrying registration after an error", function() { return it("allows retrying registration after an error", function() {
var registeredMessage, retryButton, setupButton; var registeredMessage, retryButton, setupButton;
setupButton = this.container.find("#js-setup-u2f-device"); setupButton = this.container.find("#js-setup-u2f-device");
setupButton.click; setupButton.click();
this.u2fDevice.respondToRegisterRequest({ this.u2fDevice.respondToRegisterRequest({
errorCode: "error!" errorCode: "error!"
}); });
retryButton = this.container.find("#U2FTryAgain"); retryButton = this.container.find("#U2FTryAgain");
retryButton.click; retryButton.click();
setupButton = this.container.find("#js-setup-u2f-device"); setupButton = this.container.find("#js-setup-u2f-device");
setupButton.click; setupButton.click();
this.u2fDevice.respondToRegisterRequest({ this.u2fDevice.respondToRegisterRequest({
deviceData: "this is data from the device" deviceData: "this is data from the device"
}); });
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment