-
Notifications
You must be signed in to change notification settings - Fork 193
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Issue #1043. Add func test suite for image uploads.
- Loading branch information
Mike Taylor
committed
May 6, 2016
1 parent
c720361
commit 997c9bd
Showing
3 changed files
with
43 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
/* This Source Code Form is subject to the terms of the Mozilla Public | ||
* License, v. 2.0. If a copy of the MPL was not distributed with this | ||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ | ||
|
||
define([ | ||
'intern', | ||
'intern!object', | ||
'intern/chai!assert', | ||
'require' | ||
], function(intern, registerSuite, assert, require) { | ||
'use strict'; | ||
|
||
var url = intern.config.siteRoot; | ||
|
||
registerSuite({ | ||
name: 'Image Uploads (non-auth)', | ||
|
||
'postMessaged dataURI': function() { | ||
return this.remote | ||
.setFindTimeout(intern.config.wc.pageLoadTimeout) | ||
.get(require.toUrl(url + '?open=1')) | ||
// send a small base64 encode green test square | ||
This comment has been minimized.
Sorry, something went wrong. |
||
.execute('postMessage("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABkAAAAZCAIAAABLixI0AAAACXBIWXMAAA7DAAAOwwHHb6hkAAAAB3RJTUUH3gYSAig452t/EQAAAClJREFUOMvtzkENAAAMg0A25ZU+E032AQEXoNcApCGFLX5paWlpaWl9dqq9AS6CKROfAAAAAElFTkSuQmCC", "http://localhost:5000")') | ||
.findByCssSelector('.js-image-upload-label').getAttribute('style') | ||
.then(function(inlineStyle) { | ||
assert.include(inlineStyle, 'data:image/png;base64,iVBOR', 'Base64 data shown as preview background'); | ||
}) | ||
.end() | ||
.findByCssSelector('button.wc-UploadForm-button').isDisplayed() | ||
.then(function(isDisplayed) { | ||
assert.equal(isDisplayed, true, 'Remove upload button is displayed'); | ||
}).click() | ||
.end() | ||
.findByCssSelector('.js-image-upload-label').getAttribute('style') | ||
.then(function(inlineStyle) { | ||
assert.notInclude(inlineStyle, 'data:image/png;base64,iVBOR', 'Base64 data preview removed'); | ||
}); | ||
} | ||
}); | ||
}); |
*encoded