Skip to content

Commit

Permalink
ci: Fixed storybook robot model version desync (#138)
Browse files Browse the repository at this point in the history
  • Loading branch information
evrys authored Nov 6, 2024
1 parent d55a07d commit 4eef6e4
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions stories/robots/robotStoryConfig.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import type { Meta, StoryObj } from "@storybook/react"
import { expect, fn, waitFor } from "@storybook/test"
import type { DHParameter } from "@wandelbots/wandelbots-js"
import { defaultGetModel, SupportedRobot } from "../../src"
import { SupportedRobot } from "../../src"
import { SupportedRobotScene } from "./SupportedRobotScene"

type RobotJsonConfig = {
Expand Down Expand Up @@ -43,12 +43,10 @@ export const sharedStoryConfig = {
component: SupportedRobot,
args: {
getModel: (modelFromController: string) => {
// Fetch from local models in development or testing storybook rather than CDN
if (process.env.NODE_ENV === "development" || navigator.webdriver) {
return `/models/${modelFromController}.glb`
} else {
return defaultGetModel(modelFromController)
}
// Fetch from storybook rather than CDN to ensure version alignment
// FIXME - storybook should know what version of the package it is
// so it can test the CDN as well
return `./models/${modelFromController}.glb`
},
},
} satisfies Meta<typeof SupportedRobot>
Expand Down

0 comments on commit 4eef6e4

Please sign in to comment.