Skip to content

Commit

Permalink
finishing EB core test init
Browse files Browse the repository at this point in the history
  • Loading branch information
dxnn committed Feb 25, 2015
1 parent 1280df2 commit 7c518f6
Show file tree
Hide file tree
Showing 3 changed files with 104 additions and 5 deletions.
4 changes: 1 addition & 3 deletions core/EB.js
Original file line number Diff line number Diff line change
Expand Up @@ -597,14 +597,13 @@ EB.implementSecureInterface = function(useSecureInfo, addIdentity, addAlias, set
EB.removeIdentity = removeIdentity

EB.getCurrentUsername = function() {
// yes, this technique allows you to leak data out of useSecureInfo. no, you should not use it.
// NOTE: we're using the output var to leak information out of useSecureInfo. be careful with this technique.
var output
EB.useSecureInfo(function(identities, username) { output = username })
return output
}

EB.getCurrentCapa = function() {
// yes, this technique allows you to leak data out of useSecureInfo. no, you should not use it.
var output
EB.useSecureInfo(function(identities, username) { output = ((identities[username]||{}).primary||{}).capa||0 })
return output
Expand Down Expand Up @@ -635,7 +634,6 @@ EB.implementSecureInterface = function(useSecureInfo, addIdentity, addAlias, set
}

EB.getAllIdentityUsernames = function() {
// yes, this technique allows you to leak data out of useSecureInfo. no, you should not use it.
var output
EB.useSecureInfo(function(identities, username) { output = Object.keys(identities) })
return output
Expand Down
4 changes: 2 additions & 2 deletions tests/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@

<h2>Everybit.js Test Suite</h2>

<p>You'll need to `gulp debug` before running these tests.</p>

<p><a href="mocha.html">Run full tests</a></p>

<h4>Individual Suites</h4>
Expand All @@ -18,7 +20,5 @@ <h4>Individual Suites</h4>
<p><a href="mocha.html?grep=Integration%20Tests%20for%20Identity%20Management">Run identity tests</a></p>
<p><a href="mocha.html?grep=Validations">Run specification tests</a></p>



</body>
</html>
101 changes: 101 additions & 0 deletions tests/test_identity.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,107 @@ describe('Integration Tests for Identity Management', function() {

})


// SECURE INFORMATION INTERFACE


describe('EB.useSecureInfo', function() {

it.skip('should allow access to the secure information module', function() {

})

})

describe('EB.addIdentity', function() {

it.skip('should allow direct identity creation', function() {

})

})

describe('EB.addAlias', function() {

it.skip('should allow addition of an alias to an identity', function() {

})

})

// TODO: ..asdf,asdfjasldkfjaslkdjf
describe('EB.setPrimaryAlias', function() {

it.skip('should allow ', function() {

})

})

describe('EB.setPreference', function() {

it.skip('should allow setting of preference particular preference', function() {

})

})

describe('EB.switchIdentityTo', function() {

it.skip('should allow switching the currently active identity', function() {

})

})

describe('EB.removeIdentity', function() {

it.skip('should allow removing an identity', function() {

})

})

describe('EB.getCurrentUsername', function() {

it.skip('should get the current username', function() {

})

})

describe('EB.getCurrentCapa', function() {

it.skip('should get the version of the current username', function() {

})

})

describe('EB.getCurrentVersionedUsername', function() {

it.skip('should get the versioned version of the current username', function() {

})

})

describe('EB.getCurrentUserRecord', function() {

it.skip('should get the current userRecord', function() {

})

})

describe('EB.getAllIdentityUsernames', function() {

it.skip('should get the primary usernames for existing identities', function() {

})

})



})

0 comments on commit 7c518f6

Please sign in to comment.