return function()local Y=require(script.Parent.Parent.assertDeepEqual)local i=require(script.Parent.Parent.createElement)local h=require(script.Parent.Parent.createReconciler)local x=require(script.Parent.Parent.None)local C=require(script.Parent.Parent.NoopRenderer)local P=require(script.Parent.Parent.Component)local R=h(C)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 h={a=3;b=2}local x=P:extend("\070\111\111")x.defaultProps=h local C function x.init(Y)C=Y.props end function x.render(Y) end local K={b=4;c=6}local A=i(x,K)local q=nil local k="\083\111\109\101 \070\111\111"R.mountVirtualNode(A,q,k)local H={a=h.a,b=K.b;c=K.c}Y(C,H)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 h={a=3,b=2}local x=P:extend("\070\111\111")x.defaultProps=h local C function x.render(Y)C=Y.props end local K={b=4,c=6}local A=i(x,K)local q=nil local k="\083\111\109\101 \070\111\111"local H=R.mountVirtualNode(A,q,k)local D={c=5}local N=i(x,D)R.updateVirtualNode(H,N)local Z={a=h.a;b=h.b,c=D.c}Y(C,Z)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 h={a=3;b=2}local C=P:extend("\070\111\111")C.defaultProps=h local K function C.render(Y)K=Y.props end local A={b=x,c=4}local q=i(C,A)local k=nil local H="\083\111\109\101 \070\111\111"R.mountVirtualNode(q,k,H)local D={a=h.a,b=nil,c=A.c}Y(K,D)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
