forked from remotestorage/remotestorage.js
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
94 additions
and
36 deletions.
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
Large diffs are not rendered by default.
Oops, something went wrong.
File renamed without changes.
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 |
---|---|---|
|
@@ -95,31 +95,76 @@ define(['util', 'require', './build/eventhandling', './build/solid', | |
|
||
var tests = [ | ||
{ | ||
desc: "#configure sets 'connected' to true, once sessionProperties is given", | ||
desc: "#configure sets userAddress when given", | ||
run: function (env, test) { | ||
env.client.configure({ | ||
sessionProperties: { } | ||
userAddress: '[email protected]' | ||
}); | ||
test.assert(env.client.connected, true); | ||
test.assert(env.client.userAddress, '[email protected]'); | ||
} | ||
}, | ||
|
||
{ | ||
desc: "#configure sets userAddress when given", | ||
desc: "#configure sets authURL when given", | ||
run: function (env, test) { | ||
env.client.configure({ | ||
userAddress: '[email protected]' | ||
href: 'https://solidcommunity.net' | ||
}); | ||
test.assert(env.client.userAddress, '[email protected]'); | ||
test.assert(env.client.authURL, 'https://solidcommunity.net'); | ||
} | ||
}, | ||
|
||
|
||
{ | ||
desc: "#configure sets sessionProperties when given", | ||
run: function (env, test) { | ||
env.client.configure({ | ||
properties: { | ||
sessionProperties: { check: true } | ||
} | ||
}); | ||
test.assert(env.client.sessionProperties, { check: true }); | ||
} | ||
}, | ||
{ | ||
desc: "#configure sets podURL when given", | ||
run: function (env, test) { | ||
env.client.configure({ | ||
properties: { | ||
podURL: 'https://example.solidcommunity.net/' | ||
} | ||
}); | ||
test.assert(env.client.selectedPodURL, 'https://example.solidcommunity.net/'); | ||
} | ||
}, | ||
{ | ||
desc: "#setAuthURL will update auth URL", | ||
run: function (env, test) { | ||
env.client.setAuthURL('https://solidcommunity.net'); | ||
test.assert(env.client.authURL, 'https://solidcommunity.net'); | ||
} | ||
}, | ||
{ | ||
desc: "#setPodURL will update the selected pod URL", | ||
run: function (env, test) { | ||
env.client.setPodURL('https://example.solidcommunity.net/'); | ||
test.assert(env.client.selectedPodURL, 'https://example.solidcommunity.net/'); | ||
} | ||
}, | ||
{ | ||
desc: "#connect will emit error if the auth URL is not set", | ||
run: function (env, test) { | ||
const errorCheck = { hasError: false }; | ||
env.rs.on('error', function(error) { | ||
test.assert(error.message, 'No authURL is configured.'); | ||
errorCheck.hasError = true; | ||
}); | ||
env.client.connect(); | ||
test.assert(errorCheck.hasError, true); | ||
} | ||
} | ||
]; | ||
|
||
suites.push({ | ||
name: "Solid", | ||
desc: "Solid back-end", | ||
desc: "session configuration & setup", | ||
setup: setup, | ||
beforeEach: beforeEach, | ||
afterEach: afterEach, | ||
|