Skip to content

Commit

Permalink
Fix some merge issues
Browse files Browse the repository at this point in the history
  • Loading branch information
vocksel committed Apr 22, 2024
1 parent 9e1593a commit c75a6b1
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 22 deletions.
6 changes: 1 addition & 5 deletions example/ReactCounter.stories.luau
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
local Example = script:FindFirstAncestor("Example")

local React = require(Example.Parent.Packages.React)
<<<<<<<< HEAD:example/ReactCounter.stories.lua
local ReactRoblox = require(Example.Parent.Packages.ReactRoblox)
local constants = require(Example.Parent.constants)
========
>>>>>>>> origin/main:example/ReactCounter.story.luau
local ReactCounter = require(script.Parent.ReactCounter)
local ReactRoblox = require(Example.Parent.Packages.ReactRoblox)
local constants = require(Example.Parent.constants)

local controls = {
increment = 1,
Expand Down
6 changes: 3 additions & 3 deletions src/Storybook/isStoryModule.spec.luau
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,18 @@ test("return `true` for a ModuleScript with .story in the name", function()
local module = Instance.new("ModuleScript")
module.Name = if constants.FLAG_ENABLE_COMPONENT_STORY_FORMAT then "Foo.stories" else "Foo.story"

expect(isStoryModule(module)).to.equal(true)
expect(isStoryModule(module)).toBe(true)
end)

test("return `false` if the given instance is not a ModuleScript", function()
local folder = Instance.new("Folder")
folder.Name = if constants.FLAG_ENABLE_COMPONENT_STORY_FORMAT then "Foo.stories" else "Folder.story"

expect(isStoryModule(folder)).to.equal(false)
expect(isStoryModule(folder)).toBe(false)
end)

test("return `false` if a ModuleScript does not have .story in the name", function()
local module = Instance.new("ModuleScript")

expect(isStoryModule(module)).to.equal(false)
expect(isStoryModule(module)).toBe(false)
end)
28 changes: 14 additions & 14 deletions src/Storybook/loadStoryModule.spec.luau
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ test("load a story module as a table", function()

local story = loadStoryModule(loader, storyModule, MOCK_PLAIN_STORYBOOK)

expect(story.name).to.equal("Sample")
expect(story.name).toEqual("Sample")
end)

test("handle Hoarcekat stories", function()
Expand All @@ -75,7 +75,7 @@ test("handle Hoarcekat stories", function()

local story = loadStoryModule(loader, storyModule, MOCK_PLAIN_STORYBOOK)

expect(story).to.be.ok()
expect(story).toBeDefined()
end)

test("use the name of the story module for the story name", function()
Expand All @@ -89,7 +89,7 @@ test("use the name of the story module for the story name", function()

local story = loadStoryModule(loader, storyModule, MOCK_PLAIN_STORYBOOK)

expect(story.name).to.equal(storyModule.Name)
expect(story.name).toEqual(storyModule.Name)
end)

test("pass the storybook's renderer to the story", function()
Expand All @@ -102,16 +102,16 @@ test("pass the storybook's renderer to the story", function()

local story, err = loadStoryModule(loader, storyModule, MOCK_REACT_STORYBOOK)

expect(story).to.be.ok()
expect(err).never.to.be.ok()
expect(story.react).to.be.ok()
expect(story.reactRoblox).to.be.ok()
expect(story).toBeDefined()
expect(err).toBeNil()
expect(story.react).toBeDefined()
expect(story.reactRoblox).toBeDefined()

story, err = loadStoryModule(loader, storyModule, MOCK_ROACT_STORYBOOK)

expect(story).to.be.ok()
expect(err).never.to.be.ok()
expect(story.roact).to.be.ok()
expect(story).toBeDefined()
expect(err).toBeNil()
expect(story.roact).toBeDefined()
end)

test("generic failures for stories", function()
Expand All @@ -123,8 +123,8 @@ test("generic failures for stories", function()

local story, err = loadStoryModule(loader, storyModule, MOCK_PLAIN_STORYBOOK)

expect(story).never.to.be.ok()
expect(err).to.be.ok()
expect(story).toBeNil()
expect(err).toBeDefined()
end)

test("malformed stories", function()
Expand All @@ -138,6 +138,6 @@ test("malformed stories", function()

local story, err = loadStoryModule(loader, storyModule, MOCK_PLAIN_STORYBOOK)

expect(story).never.to.be.ok()
expect(err).to.be.ok()
expect(story).toBeNil()
expect(err).toBeDefined()
end)

0 comments on commit c75a6b1

Please sign in to comment.