You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

43 lines
938 B

import { removeKey, setKey, getKey } from "../src/services/Keystore";
test('calls set keystore key', () => {
return setKey('100', '100')
.then((outcome) => {
expect(outcome).toEqual(true);
});
});
test('calls get keystore key', () => {
return getKey('100')
.then((outcome) => {
expect(outcome).toEqual('1234567890');
});
})
test('calls remove keystore key', () => {
return removeKey('100')
.then((outcome) => {
expect(outcome).toEqual(true);
});
})
test('get non-existing keystore key', () => {
return getKey('notakey')
.then((outcome) => {
expect(outcome).toEqual(null);
});
})
test('remove non-existing keystore key', () => {
return removeKey('notakey')
.then((outcome) => {
expect(outcome).toEqual(false);
});
})
test('setKey handles case where settings fails', () => {
return setKey('savefailed')
.then((outcome) => {
expect(outcome).toEqual(false);
});
})