return function()local K=require(script.Parent.Parent.assertDeepEqual)local e=require(script.Parent.Parent.createElement)local B=require(script.Parent.Parent.createReconciler)local M=require(script.Parent.Parent.None)local x=require(script.Parent.Parent.NoopRenderer)local u=require(script.Parent.Parent.Component)local P=B(x)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 B={a=3,b=2}local M=u:extend("\070\111\111")M.defaultProps=B local x function M.init(K)x=K.props end function M.render(K) end local J={b=4,c=6}local C=e(M,J)local g=nil local p="\083\111\109\101 \070\111\111"P.mountVirtualNode(C,g,p)local j={a=B.a;b=J.b,c=J.c}K(x,j)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 B={a=3,b=2}local M=u:extend("\070\111\111")M.defaultProps=B local x function M.render(K)x=K.props end local J={b=4;c=6}local C=e(M,J)local g=nil local p="\083\111\109\101 \070\111\111"local j=P.mountVirtualNode(C,g,p)local U={c=5}local v=e(M,U)P.updateVirtualNode(j,v)local r={a=B.a;b=B.b;c=U.c}K(x,r)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 B={a=3;b=2}local x=u:extend("\070\111\111")x.defaultProps=B local J function x.render(K)J=K.props end local C={b=M;c=4}local g=e(x,C)local p=nil local j="\083\111\109\101 \070\111\111"P.mountVirtualNode(g,p,j)local U={a=B.a,b=nil,c=C.c}K(J,U)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