()
| 29 | #[tokio::test] |
| 30 | #[expect(clippy::too_many_lines)] |
| 31 | async fn insert() { |
| 32 | let alice = serde_json::from_str(entity::PERSON_ALICE_V1).expect("could not parse entity"); |
| 33 | let bob = serde_json::from_str(entity::PERSON_BOB_V1).expect("could not parse entity"); |
| 34 | let friend_of = PropertyObject::empty(); |
| 35 | |
| 36 | let mut database = DatabaseTestWrapper::new().await; |
| 37 | let mut api = database |
| 38 | .seed( |
| 39 | [ |
| 40 | data_type::VALUE_V1, |
| 41 | data_type::TEXT_V1, |
| 42 | data_type::NUMBER_V1, |
| 43 | ], |
| 44 | [ |
| 45 | property_type::NAME_V1, |
| 46 | property_type::AGE_V1, |
| 47 | property_type::FAVORITE_SONG_V1, |
| 48 | property_type::FAVORITE_FILM_V1, |
| 49 | property_type::HOBBY_V1, |
| 50 | property_type::INTERESTS_V1, |
| 51 | ], |
| 52 | [ |
| 53 | entity_type::LINK_V1, |
| 54 | entity_type::link::FRIEND_OF_V1, |
| 55 | entity_type::link::ACQUAINTANCE_OF_V1, |
| 56 | entity_type::PERSON_V1, |
| 57 | ], |
| 58 | ) |
| 59 | .await |
| 60 | .expect("could not seed database"); |
| 61 | |
| 62 | let person_type_id = VersionedUrl { |
| 63 | base_url: BaseUrl::new( |
| 64 | "https://blockprotocol.org/@alice/types/entity-type/person/".to_owned(), |
| 65 | ) |
| 66 | .expect("couldn't construct Base URL"), |
| 67 | version: OntologyTypeVersion { |
| 68 | major: 1, |
| 69 | pre_release: None, |
| 70 | }, |
| 71 | }; |
| 72 | |
| 73 | let alice_entity = api |
| 74 | .create_entity( |
| 75 | api.account_id, |
| 76 | CreateEntityParams { |
| 77 | web_id: WebId::new(api.account_id), |
| 78 | entity_uuid: None, |
| 79 | decision_time: None, |
| 80 | entity_type_ids: HashSet::from([person_type_id.clone()]), |
| 81 | properties: PropertyObjectWithMetadata::from_parts(alice, None) |
| 82 | .expect("could not create property with metadata object"), |
| 83 | link_data: None, |
| 84 | draft: false, |
| 85 | policies: Vec::new(), |
| 86 | confidence: None, |
| 87 | provenance: ProvidedEntityEditionProvenance { |
| 88 | actor_type: ActorType::User, |
nothing calls this directly
no test coverage detected