return function()local O=script.Parent local Z=O.Parent local H=Z.Parent local g=(require(H.Dev.JestGlobals)).expect local D=require(Z.getAny)local Q=require(O.InstanceSetup)local w=nil local R=nil afterEach(function()if R then R()R=nil end end)it("\114\101\116\117\114\110\115 \116\104\101 \105\110\115\116\097\110\099\101 \116\097\103\103\101\100 \119\105\116\104 \096\111\111\102\096",function()w,R=Q.create({oof={"\111\111\102"}});(g(D("\111\111\102"))).toEqual(g.arrayContaining({w.oof}))end)it("\114\101\116\117\114\110\115 \109\117\108\116\105\112\108\101 \105\110\115\116\097\110\099\101\115 \116\097\103\103\101\100 \119\105\116\104 \096\098\117\116\116\111\110\096",function()w,R=Q.create({buttonA={"\098\117\116\116\111\110"},buttonB={"\098\117\116\116\111\110","\097\110\105\109\097\116\101\100"}});(g(D("\098\117\116\116\111\110"))).toEqual(g.arrayContaining({w.oof,w.oof2}))end)it("\114\101\116\117\114\110\115 \116\104\101 \105\110\115\116\097\110\099\101 \116\097\103\103\101\100 \119\105\116\104 \096\108\105\110\107\096 \111\114 \096\116\111\111\108\116\105\112\096",function()w,R=Q.create({frame={"\097\110\105\109\097\116\101\100"};button={"\108\105\110\107"},tooltipButton={"\108\105\110\107";"\116\111\111\108\116\105\112"},tooltipAnimatedButton={"\116\111\111\108\116\105\112";"\097\110\105\109\097\116\101\100"}});(g(D("\108\105\110\107","\116\111\111\108\116\105\112"))).toEqual(g.arrayContaining({w.button,w.tooltipButton,w.tooltipAnimatedButton}))end)it("\114\101\116\117\114\110\115 \097\110 \101\109\112\116\121 \108\105\115\116 \105\102 \116\104\101\114\101 \105\115 \110\111 \105\110\115\116\097\110\099\101\115 \116\097\103\103\101\100 \119\105\116\104 \096\097\110\105\109\097\116\101\100\096",function()w,R=Q.create({button={"\098\117\116\116\111\110"}});(g(D("\097\110\105\109\097\116\101\100"))).toEqual({})end)end
return function()
	local tests = script.Parent
	local root = tests.Parent
	local Packages = root.Parent

	local expect = require(Packages.Dev.JestGlobals).expect
	local getAny = require(root.getAny)

	local InstanceSetup = require(tests.InstanceSetup)

	local instances = nil
	local cleanInstances = nil

	afterEach(function()
		if cleanInstances then
			cleanInstances()
			cleanInstances = nil
		end
	end)

	it("returns the instance tagged with `oof`", function()
		instances, cleanInstances = InstanceSetup.create({
			oof = { "oof" },
		})
		expect(getAny("oof")).toEqual(expect.arrayContaining({ instances.oof }))
	end)

	it("returns multiple instances tagged with `button`", function()
		instances, cleanInstances = InstanceSetup.create({
			buttonA = { "button" },
			buttonB = { "button", "animated" },
		})
		expect(getAny("button")).toEqual(
			expect.arrayContaining({ instances.oof, instances.oof2 })
		)
	end)

	it("returns the instance tagged with `link` or `tooltip`", function()
		instances, cleanInstances = InstanceSetup.create({
			frame = { "animated" },
			button = { "link" },
			tooltipButton = { "link", "tooltip" },
			tooltipAnimatedButton = { "tooltip", "animated" },
		})
		expect(getAny("link", "tooltip")).toEqual(expect.arrayContaining({
			instances.button,
			instances.tooltipButton,
			instances.tooltipAnimatedButton,
		}))
	end)

	it("returns an empty list if there is no instances tagged with `animated`", function()
		instances, cleanInstances = InstanceSetup.create({
			button = { "button" },
		})
		expect(getAny("animated")).toEqual({})
	end)
end
