1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-16 00:03:56 +00:00

State definitions tests (#7173)

* Add StateDefinition Tests and Rules

* Update Comments
This commit is contained in:
Justin Baur
2023-12-14 10:00:36 -05:00
committed by GitHub
parent 60d9f3d150
commit 7abbe0dafd
2 changed files with 70 additions and 0 deletions

View File

@@ -1,3 +1,20 @@
import { StateDefinition } from "./state-definition";
/**
* `StateDefinition`s comes with some rules, to facilitate a quick review from
* platform of this file, ensure you follow these rules, the ones marked with (tested)
* have unit tests that you can run locally.
*
* 1. (tested) Names should not be null or undefined
* 2. (tested) Name and storage location should be unique
* 3. (tested) Name and storage location can't differ from another export by only casing
* 4. (tested) Name should be longer than 3 characters. It should be descriptive, but brief.
* 5. (tested) Name should not contain spaces or underscores
* 6. Name should be human readable
* 7. Name should be in camelCase format (unit tests ensure the first character is lowercase)
* 8. Teams should only use state definitions they have created
* 9. StateDefinitions should only be used for keys relating to the state name they chose
*
*/
export const ACCOUNT_MEMORY = new StateDefinition("account", "memory");