# This file is auto-generated by alef — DO NOT EDIT.
# alef:hash:4e15143f4af1ae8bafbdb1506ef057da924484c66a19483966333558ad437e75
# To regenerate: alef generate
# To verify freshness: alef verify --exit-code
# Issues & docs: https://github.com/kreuzberg-dev/alef
# E2e tests for category: embeddings

test_that("embed_texts_different_preset: embed_texts: multilingual preset", {
  result <- embed_texts(texts = c("Hello world", "Test"), config = EmbeddingConfig$from_json(jsonlite::toJSON(list("model" = list("name" = "multilingual", "type" = "preset")), auto_unbox = TRUE)))
  expect_true(TRUE)
  expect_gte(length((if (is.character(result) && length(result) == 1) jsonlite::fromJSON(result, simplifyVector = FALSE) else result)), 2)
})

test_that("get_embedding_preset_known: get_embedding_preset: known preset", {
  result <- get_embedding_preset(name = "balanced")
  expect_true(TRUE)
})

test_that("get_embedding_preset_nominal: get_embedding_preset: nominal case", {
  result <- get_embedding_preset(name = "balanced")
  expect_true(TRUE)
})

test_that("get_embedding_preset_unknown: get_embedding_preset: unknown preset fails", {
  result <- get_embedding_preset(name = "nonexistent-xyz")
  expect_true(is.null(result) || length(result) == 0 || (length(result) == 1 && (is.na(result) || identical(result, ""))))
})

test_that("list_embedding_presets_sanity: list_embedding_presets: returns at least one", {
  result <- list_embedding_presets()
  expect_true(if (is.character(result)) length(result) > 0 && any(nchar(result) > 0) else length(result) > 0)
})
