Skip to content

Commit

Permalink
Do not show the product selector if 1 product without license
Browse files Browse the repository at this point in the history
  • Loading branch information
teclator committed Nov 26, 2021
1 parent 0b9015b commit b90f870
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
3 changes: 2 additions & 1 deletion src/lib/installation/dialogs/complex_welcome.rb
Expand Up @@ -171,8 +171,9 @@ def available_products?
# @return [Yast::Term] Product selection content; Empty() if no products
def license_or_product_content
return Empty() unless available_products?
return product_selector if products.size > 1

show_license? ? product_license : product_selector
show_license? ? product_license : Empty()
end

# UI to fill space if needed
Expand Down
10 changes: 8 additions & 2 deletions test/lib/dialogs/complex_welcome_test.rb
Expand Up @@ -46,7 +46,7 @@
end
end

describe "#content" do
describe "#contents" do
let(:license) { instance_double("Y2Packager::ProductLicense") }
let(:sles_product) { instance_double("Y2Packager::ProductSpec", label: "SLES", license: license) }
let(:sles_online_product) { instance_double("Y2Packager::ControlProductSpec", label: "SLES", license: license) }
Expand Down Expand Up @@ -86,7 +86,13 @@
end
context "when it is the offline medium" do
let(:products) { [sles_offline_product] }
include_examples "show_selector"

it "does not show the license or the product selection" do
expect(Y2Packager::Widgets::ProductLicense).to_not receive(:new)
expect(Installation::Widgets::ProductSelector).to_not receive(:new)

widget.contents
end
end
end

Expand Down

0 comments on commit b90f870

Please sign in to comment.