diff options
author | Anike Arni <aarni@thoughtworks.com> | 2017-03-30 17:23:41 -0300 |
---|---|---|
committer | Anike Arni <aarni@thoughtworks.com> | 2017-03-31 18:29:48 -0300 |
commit | 7be03150100d319c6d373241f614a29b374cb74d (patch) | |
tree | 90a553dfa0b6f119300a00e6ef02788923035e5c /web-ui/src/backup_account/backup_email/backup_email.spec.js | |
parent | f40808a147d1135e8bbee6d78306a598cf5ca647 (diff) |
[#935] Submits user recovery code to new endpoint
with @deniscostadsc
Diffstat (limited to 'web-ui/src/backup_account/backup_email/backup_email.spec.js')
-rw-r--r-- | web-ui/src/backup_account/backup_email/backup_email.spec.js | 18 |
1 files changed, 0 insertions, 18 deletions
diff --git a/web-ui/src/backup_account/backup_email/backup_email.spec.js b/web-ui/src/backup_account/backup_email/backup_email.spec.js index b23aadaa..a34afa06 100644 --- a/web-ui/src/backup_account/backup_email/backup_email.spec.js +++ b/web-ui/src/backup_account/backup_email/backup_email.spec.js @@ -3,7 +3,6 @@ import expect from 'expect'; import React from 'react'; import fetchMock from 'fetch-mock'; import { BackupEmail } from 'src/backup_account/backup_email/backup_email'; -import browser from 'helpers/browser'; describe('BackupEmail', () => { let backupEmail; @@ -104,7 +103,6 @@ describe('BackupEmail', () => { context('on success', () => { beforeEach((done) => { mockOnSubmit = expect.createSpy().andCall(() => done()); - expect.spyOn(browser, 'getCookie').andReturn('abc123'); fetchMock.post('/backup-account', 204); backupEmail = shallow(<BackupEmail t={mockTranslations} onSubmit={mockOnSubmit} />); @@ -117,26 +115,10 @@ describe('BackupEmail', () => { expect(fetchMock.called('/backup-account')).toBe(true, 'Backup account POST was not called'); }); - it('sends csrftoken as content', () => { - expect(fetchMock.lastOptions('/backup-account').body).toContain('"csrftoken":["abc123"]'); - }); - it('sends user email as content', () => { expect(fetchMock.lastOptions('/backup-account').body).toContain('"backupEmail":"test@test.com"'); }); - it('sends content-type header', () => { - expect(fetchMock.lastOptions('/backup-account').headers['Content-Type']).toEqual('application/json'); - }); - - it('sends same origin headers', () => { - expect(fetchMock.lastOptions('/backup-account').credentials).toEqual('same-origin'); - }); - - it('prevents default call to refresh page', () => { - expect(preventDefaultSpy).toHaveBeenCalled(); - }); - it('calls onSubmit from props with success', () => { expect(mockOnSubmit).toHaveBeenCalledWith('success'); }); |