huskies: merge 1016
This commit is contained in:
@@ -10,5 +10,5 @@ mod deps;
|
||||
mod parser;
|
||||
mod types;
|
||||
|
||||
pub use parser::{is_story_frozen_in_store, parse_unchecked_todos, resolve_qa_mode};
|
||||
pub use parser::{is_story_frozen_in_store, parse_unchecked_todos};
|
||||
pub use types::{ItemType, QaMode};
|
||||
|
||||
@@ -3,8 +3,6 @@
|
||||
//! Story 865 stripped YAML front matter from stored content and the codebase
|
||||
//! at large; the only remaining functions here read the CRDT or operate on
|
||||
//! the markdown body directly.
|
||||
use super::types::QaMode;
|
||||
|
||||
/// Parse unchecked todo items (`- [ ] ...`) from a markdown string.
|
||||
pub fn parse_unchecked_todos(contents: &str) -> Vec<String> {
|
||||
contents
|
||||
@@ -16,17 +14,6 @@ pub fn parse_unchecked_todos(contents: &str) -> Vec<String> {
|
||||
.collect()
|
||||
}
|
||||
|
||||
/// Resolve the effective QA mode for a story by ID via the CRDT.
|
||||
///
|
||||
/// Returns `default` when the story has no entry or its `qa_mode` register is
|
||||
/// unset. Spikes are **not** handled here — callers override to `Human` for
|
||||
/// spikes themselves.
|
||||
pub fn resolve_qa_mode(story_id: &str, default: QaMode) -> QaMode {
|
||||
crate::crdt_state::read_item(story_id)
|
||||
.and_then(|view| view.qa_mode())
|
||||
.unwrap_or(default)
|
||||
}
|
||||
|
||||
/// Return `true` if the story is currently in `Stage::Frozen`
|
||||
/// (story 945: frozen is a typed stage variant, not a flag).
|
||||
///
|
||||
@@ -70,13 +57,4 @@ mod tests {
|
||||
let input = " - [ ] Indented item\n";
|
||||
assert_eq!(parse_unchecked_todos(input), vec!["Indented item"]);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn resolve_qa_mode_falls_back_to_default_when_crdt_empty() {
|
||||
crate::crdt_state::init_for_test();
|
||||
assert_eq!(
|
||||
resolve_qa_mode("9999_no_such_story", QaMode::Server),
|
||||
QaMode::Server
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user