Skip to content

Commit

Permalink
Fix compiling issues in integration tests
Browse files Browse the repository at this point in the history
  • Loading branch information
crazytonyli committed Jan 20, 2025
1 parent b42b6ce commit 9c15897
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion wp_api/src/request.rs
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ impl WpNetworkHeaderMap {
#[uniffi::export]
impl WpNetworkHeaderMap {
#[uniffi::constructor]
fn from_multi_map(
pub fn from_multi_map(
hash_map: HashMap<String, Vec<String>>,
) -> Result<Self, WpNetworkHeaderMapError> {
let inner = hash_map
Expand Down
6 changes: 4 additions & 2 deletions wp_api_integration_tests/tests/test_posts_immut.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ use wp_api::posts::{
SparsePostFieldWithEmbedContext, SparsePostFieldWithViewContext, WpApiParamPostsOrderBy,
WpApiParamPostsSearchColumn, WpApiParamPostsTaxRelation,
};
use wp_api::request::WpNetworkHeaderMap;
use wp_api::tags::TagId;
use wp_api::{generate, WpApiParamOrder};
use wp_api_integration_tests::{
Expand All @@ -21,8 +22,9 @@ async fn list_with_edit_context_number_of_pages() {
.list_with_edit_context(&PostListParams::default())
.await
.assert_response();
assert_eq!(p.header_map.wp_total(), Some(57));
assert_eq!(p.header_map.wp_total_pages(), Some(6));
let header_map = WpNetworkHeaderMap::from_multi_map(p.header_map).unwrap();
assert_eq!(header_map.wp_total(), Some(57));
assert_eq!(header_map.wp_total_pages(), Some(6));
}

#[tokio::test]
Expand Down

0 comments on commit 9c15897

Please sign in to comment.