Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(76)

Unified Diff: appengine/config_service/ui/test/config-ui/config-set_test.html

Issue 2990713002: config_service: change error message for error 403. (Closed)
Patch Set: Nit: fix tests to reflect recent changes Created 3 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: appengine/config_service/ui/test/config-ui/config-set_test.html
diff --git a/appengine/config_service/ui/test/config-ui/config-set_test.html b/appengine/config_service/ui/test/config-ui/config-set_test.html
index 978e4c0a327e3e4f8f648fd4eb70ec7e0962aac4..bc476c2b51a268b328d18ca35cc32d97d90970a1 100644
--- a/appengine/config_service/ui/test/config-ui/config-set_test.html
+++ b/appengine/config_service/ui/test/config-ui/config-set_test.html
@@ -272,7 +272,7 @@
server.restore();
});
- test('displays error if fetch failed due to error 403', function (done) {
+ test('displays error if fetch failed due to error 403 when not signed in', function (done) {
Sergey Berezin 2017/07/27 00:05:31 nit: break the line to fit in 80 char. Or consider
ayanaadylova 2017/07/27 16:57:29 Done.
Sergey Berezin 2017/07/27 20:42:18 This wasn't actually done... Similarly other test
param = {
error: {
code: 403,
@@ -293,8 +293,39 @@
assert.equal(request.status, 403);
config_set.addEventListener('fetchError', function() {
assert.equal(config_set.isLoading, false);
- assert.equal(config_set.errorMessage, "Authorization required to view this config set." +
- " Please sign in.");
+ assert.equal(config_set.errorMessage, "Access denied, please sign in.");
Sergey Berezin 2017/07/27 00:05:31 nit: line break to fit in 80 char
ayanaadylova 2017/07/27 16:57:29 Done.
+ done();
+ }.bind(config_set));
+ });
+
+ test('displays error if fetch failed due to error 403 when signed in', function (done) {
Sergey Berezin 2017/07/27 00:05:31 nit: same as above - fit in 80 char, possibly by s
ayanaadylova 2017/07/27 16:57:29 Done.
+ param = {
Sergey Berezin 2017/07/27 00:05:31 Suggestion: consider creating a separate helper fu
ayanaadylova 2017/07/27 16:57:29 Done.
+ error: {
+ code: 403,
+ message: "Error 403"
+ }
+ }
+ server.respondWith(
+ 'GET',
+ /\/_ah\/api\/config\/v1\/config-sets\?config_set=([a-z\-]+)\/([a-z\-]+)&include_files=true&include_last_import_attempt=true/,
+ [
+ 403,
+ responseHeaders.json,
+ JSON.stringify(param)
+ ]
+ );
+ config_set.auth_headers = {};
+ config_set.profile = {
+ email: "some_email@google.com"
+ };
+ request = ajax.generateRequest();
+ server.respond();
+ assert.equal(request.status, 403);
+ config_set.addEventListener('fetchError', function() {
+ assert.equal(config_set.isLoading, false);
+ assert.equal(config_set.errorMessage, "Access denied, some_email@google.com" +
Sergey Berezin 2017/07/27 00:05:31 nit: move the second arg to new line to fit in 80
ayanaadylova 2017/07/27 16:57:29 Done.
+ " is not authorized to access this config set." +
+ " Request access or sign in as a different user.");
done();
}.bind(config_set));
});
« no previous file with comments | « appengine/config_service/ui/src/config-ui/front-page.html ('k') | appengine/config_service/ui/test/index.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698