Skip to content

Commit

Permalink
Update factory
Browse files Browse the repository at this point in the history
  • Loading branch information
EMaksy committed Mar 20, 2024
1 parent 2e1573b commit 312a52d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
10 changes: 10 additions & 0 deletions test/support/factory.ex
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,20 @@ defmodule Wanda.Factory do
%Catalog.Check{
id: UUID.uuid4(),
name: Faker.StarWars.character(),
group: Faker.Company.name(),
description: Faker.Lorem.sentence(),
remediation: Faker.Lorem.sentence(),
metadata: %{
target_type: Faker.StarWars.character(),
cluster_type: Faker.Lorem.sentence(),
provider:
Enum.take_random(["azure", "nutanix", "kvm", "vmware, gcp, aws"], Enum.random(0..6))
},
severity: Enum.random([:critical, :warning, :passing]),
facts: build_list(10, :catalog_fact),
values: build_list(10, :catalog_value),
expectations: build_list(10, :catalog_expectation),
when: Faker.Lorem.sentence(),
premium: Enum.random([false, true])
}
end
Expand Down
2 changes: 1 addition & 1 deletion test/wanda_web/views/v1/catalog_view_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ defmodule WandaWeb.V1.CatalogViewTest do
end
end

test "renders catalog.json v1 without additional properties " do
test "renders catalog.json like expected in the v1 schema" do
checks = [
build(:check, expectations: build_list(2, :catalog_expectation, type: :expect)),
build(:check, expectations: build_list(2, :catalog_expectation, type: :expect_same))
Expand Down

0 comments on commit 312a52d

Please sign in to comment.