test(disco-items): ineligible tn shows no commands

Phillip Davis created

Change summary

test/property/test_disco_items.rb | 21 +++++++++++++++++++++
1 file changed, 21 insertions(+)

Detailed changes

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