From 809763b33293f1c79567508c5c95f41b3371653e Mon Sep 17 00:00:00 2001 From: Phillip Davis Date: Tue, 3 Mar 2026 16:08:11 -0500 Subject: [PATCH] test(disco-items): ineligible tn shows no commands --- test/property/test_disco_items.rb | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/test/property/test_disco_items.rb b/test/property/test_disco_items.rb index 873f12f64785ce5852a8568ee27b7b61dba4d959..9b857706245d8d02bd5a6210e8217ca7a45492f4 100644 --- a/test/property/test_disco_items.rb +++ b/test/property/test_disco_items.rb @@ -38,4 +38,25 @@ class DiscoItemsPropertyTest < Minitest::Test } end em :test_eligible_tn_shows_port_out_pin_command + + def test_ineligible_tn_shows_no_commands + property_of { + DiscoItemsIQ.new(REDIS).generate + }.check { |_metadata, example| + BandwidthTNOptions.stub( + :tn_eligible_for_port_out_pin?, + EMPromise.resolve(false) + ) do + process_stanza(example['stanza']) + end + + assert_equal 1, written.length + reply = written.shift + + ns = 'http://jabber.org/protocol/disco#items' + items = reply.query.find('.//ns:item', ns: ns) + assert_empty items + } + end + em :test_ineligible_tn_shows_no_commands end