return function()local o=require(script.Parent.Parent.assertDeepEqual)local h=require(script.Parent.Parent.createElement)local c=require(script.Parent.Parent.createReconciler)local C=require(script.Parent.Parent.None)local W=require(script.Parent.Parent.NoopRenderer)local Z=require(script.Parent.Parent.Component)local v=c(W)it("\115\104\111\117\108\100 \102\105\108\108 \105\110 \119\104\101\110 \109\111\117\110\116\105\110\103 \098\101\102\111\114\101 \105\110\105\116",function()local c={a=3;b=2}local C=Z:extend("\070\111\111")C.defaultProps=c local W function C.init(o)W=o.props end function C.render(o) end local j={b=4;c=6}local m=h(C,j)local s=nil local Q="\083\111\109\101 \070\111\111"v.mountVirtualNode(m,s,Q)local U={a=c.a;b=j.b,c=j.c}o(W,U)end)it("\115\104\111\117\108\100 \102\105\108\108 \105\110 \119\104\101\110 \117\112\100\097\116\105\110\103 \118\105\097 \112\114\111\112\115",function()local c={a=3;b=2}local C=Z:extend("\070\111\111")C.defaultProps=c local W function C.render(o)W=o.props end local j={b=4,c=6}local m=h(C,j)local s=nil local Q="\083\111\109\101 \070\111\111"local U=v.mountVirtualNode(m,s,Q)local K={c=5}local H=h(C,K)v.updateVirtualNode(U,H)local S={a=c.a,b=c.b;c=K.c}o(W,S)end)it("\115\104\111\117\108\100 \114\101\115\112\101\099\116 \078\111\110\101 \116\111 \111\118\101\114\114\105\100\101 \097 \100\101\102\097\117\108\116 \112\114\111\112 \119\105\116\104 \110\105\108",function()local c={a=3;b=2}local W=Z:extend("\070\111\111")W.defaultProps=c local j function W.render(o)j=o.props end local m={b=C;c=4}local s=h(W,m)local Q=nil local U="\083\111\109\101 \070\111\111"v.mountVirtualNode(s,Q,U)local K={a=c.a,b=nil,c=m.c}o(j,K)end)end
return function()
	local assertDeepEqual = require(script.Parent.Parent.assertDeepEqual)
	local createElement = require(script.Parent.Parent.createElement)
	local createReconciler = require(script.Parent.Parent.createReconciler)
	local None = require(script.Parent.Parent.None)
	local NoopRenderer = require(script.Parent.Parent.NoopRenderer)

	local Component = require(script.Parent.Parent.Component)

	local noopReconciler = createReconciler(NoopRenderer)

	it("should fill in when mounting before init", function()
		local defaultProps = {
			a = 3,
			b = 2,
		}

		local Foo = Component:extend("Foo")

		Foo.defaultProps = defaultProps

		local capturedProps
		function Foo:init()
			capturedProps = self.props
		end

		function Foo:render() end

		local initialProps = {
			b = 4,
			c = 6,
		}

		local element = createElement(Foo, initialProps)
		local hostParent = nil
		local key = "Some Foo"

		noopReconciler.mountVirtualNode(element, hostParent, key)

		local expectedProps = {
			a = defaultProps.a,
			b = initialProps.b,
			c = initialProps.c,
		}

		assertDeepEqual(capturedProps, expectedProps)
	end)

	it("should fill in when updating via props", function()
		local defaultProps = {
			a = 3,
			b = 2,
		}

		local Foo = Component:extend("Foo")

		Foo.defaultProps = defaultProps

		local capturedProps
		function Foo:render()
			capturedProps = self.props
		end

		local initialProps = {
			b = 4,
			c = 6,
		}

		local element = createElement(Foo, initialProps)
		local hostParent = nil
		local key = "Some Foo"

		local node = noopReconciler.mountVirtualNode(element, hostParent, key)

		local updatedProps = {
			c = 5,
		}
		local updatedElement = createElement(Foo, updatedProps)

		noopReconciler.updateVirtualNode(node, updatedElement)

		local expectedProps = {
			a = defaultProps.a,
			b = defaultProps.b,
			c = updatedProps.c,
		}

		assertDeepEqual(capturedProps, expectedProps)
	end)

	it("should respect None to override a default prop with nil", function()
		local defaultProps = {
			a = 3,
			b = 2,
		}

		local Foo = Component:extend("Foo")

		Foo.defaultProps = defaultProps

		local capturedProps
		function Foo:render()
			capturedProps = self.props
		end

		local initialProps = {
			b = None,
			c = 4,
		}

		local element = createElement(Foo, initialProps)
		local hostParent = nil
		local key = "Some Foo"

		noopReconciler.mountVirtualNode(element, hostParent, key)

		local expectedProps = {
			a = defaultProps.a,
			b = nil,
			c = initialProps.c,
		}

		assertDeepEqual(capturedProps, expectedProps)
	end)
end
