Skip to content

Commit 39eb1a0

Browse files
committed
Fix l10n service tests
1 parent 69b0ee3 commit 39eb1a0

File tree

3 files changed

+9
-2
lines changed

3 files changed

+9
-2
lines changed

rust/agama-l10n/src/model/locale.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ impl LocalesDatabase {
5959
#[cfg(test)]
6060
pub fn with_entries(data: &[LocaleEntry]) -> Self {
6161
Self {
62-
known_locales: vec![],
62+
known_locales: data.iter().map(|l| l.id.clone()).collect(),
6363
locales: data.to_vec(),
6464
}
6565
}

rust/agama-l10n/src/service.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,10 +89,11 @@ impl Service {
8989
) -> Service {
9090
let system = SystemInfo::read_from(&model);
9191
let config = ExtendedConfig::new_from(&system);
92+
let proposal = (&config).into();
9293
let state = State {
9394
system,
9495
config,
95-
proposal: None,
96+
proposal: Some(proposal),
9697
};
9798

9899
Self {

rust/agama-l10n/src/start.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,9 @@ mod tests {
172172
let updated = handler.call(message::GetConfig).await?;
173173
assert_eq!(&updated, &input_config);
174174

175+
let proposal = handler.call(message::GetProposal).await?;
176+
assert!(proposal.is_some());
177+
175178
let event = events_rx.recv().await.expect("Did not receive the event");
176179
assert!(matches!(event, Event::ProposalChanged));
177180
Ok(())
@@ -226,6 +229,9 @@ mod tests {
226229
let found_issues = issues.call(issue::message::Get).await?;
227230
let l10n_issues = found_issues.get("localization").unwrap();
228231
assert_eq!(l10n_issues.len(), 3);
232+
233+
let proposal = handler.call(message::GetProposal).await?;
234+
assert!(proposal.is_none());
229235
Ok(())
230236
}
231237

0 commit comments

Comments
 (0)