Skip to content
Snippets Groups Projects
Commit 04444789 authored by Jono Wenger's avatar Jono Wenger
Browse files

Add tests for StoreIndexedDbEncryptionStatus

parent 1450d153
No related branches found
No related tags found
1 merge request!18XX-4272 / Purge
This commit is part of merge request !18. Comments created here will be created in the context of that merge request.
////////////////////////////////////////////////////////////////////////////////
// Copyright © 2022 xx foundation //
// //
// Use of this source code is governed by a license that can be found in the //
// LICENSE file. //
////////////////////////////////////////////////////////////////////////////////
//go:build js && wasm
package storage
import (
"testing"
)
// Tests that StoreIndexedDbEncryptionStatus stores the initial encryption value
// and return that value on subsequent checks.
func TestStoreIndexedDbEncryptionStatus(t *testing.T) {
databaseName := "databaseA"
encrypted, err := StoreIndexedDbEncryptionStatus(databaseName, true)
if err != nil {
t.Errorf("Failed to store/get encryption status: %+v", err)
}
if encrypted != true {
t.Errorf("Incorrect encryption values.\nexpected: %t\nreceived: %t",
true, encrypted)
}
encrypted, err = StoreIndexedDbEncryptionStatus(databaseName, false)
if err != nil {
t.Errorf("Failed to store/get encryption status: %+v", err)
}
if encrypted != true {
t.Errorf("Incorrect encryption values.\nexpected: %t\nreceived: %t",
true, encrypted)
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment