Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

calling prop_def twice on a task creates multiple properties with the same name #118

Open
jacobe90 opened this issue May 3, 2024 · 0 comments
Assignees
Labels
bug Something isn't working
Milestone

Comments

@jacobe90
Copy link
Collaborator

jacobe90 commented May 3, 2024

see this test for behavior

async fn test_prop_def_twice() {
let (server, mut state, mut receiver, view_key) = test_init().await;
let view = state.view_get(view_key).unwrap();
assert_eq!(view.name, "Main View");
let mut tasks = view.tasks.as_ref().unwrap().iter().cloned().collect::<Vec<TaskKey>>();
tasks.sort(); // make keys are in sorted order
// assign a date to tasks[0]
let name_key = state.prop_def_name("random property");
let old_prop_key = state.prop_def(tasks[0], name_key, TaskPropVariant::Date(NaiveDate::from_ymd_opt(2016, 7, 8).unwrap().into())).unwrap();
let prop_key = state.prop_def(tasks[0], name_key, TaskPropVariant::String(String::from("j"))).unwrap();
let old_prop_ref = &state.props[old_prop_key];
let new_prop_ref = &state.props[prop_key];
// both should have type "string"
assert_eq!(old_prop_ref.type_string(), new_prop_ref.type_string());
}

@jacobe90 jacobe90 assigned jacobe90 and zontasticality and unassigned jacobe90 May 3, 2024
@jacobe90 jacobe90 added the bug Something isn't working label May 3, 2024
@jacobe90 jacobe90 added this to the 1.0 release milestone May 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants