@@ -5,15 +5,10 @@ import {
55 reactRouterParameters ,
66} from "storybook-addon-remix-react-router" ;
77import { buildInfoKey } from "#/api/queries/buildInfo" ;
8- import { chatModels } from "#/api/queries/chats" ;
98import { deploymentStatsQueryKey } from "#/api/queries/deployment" ;
109import { organizationsPermissions } from "#/api/queries/organizations" ;
1110import { updateCheckQueryKey } from "#/api/queries/updateCheck" ;
1211import type { UpdateCheckResponse } from "#/api/typesGenerated" ;
13- import {
14- MockChatModel ,
15- MockChatModelProviderDescriptor ,
16- } from "#/testHelpers/chatModels" ;
1712import {
1813 MockBuildInfo ,
1914 MockDefaultOrganization ,
@@ -55,17 +50,6 @@ const mcpServersRouter = reactRouterParameters({
5550 ] ,
5651} ) ;
5752
58- const modelSettingsRouter = reactRouterParameters ( {
59- location : { path : "/" } ,
60- routing : [
61- { path : "/" , useStoryElement : true } ,
62- {
63- path : "/ai/settings/models" ,
64- element : < h1 > Organization models</ h1 > ,
65- } ,
66- ] ,
67- } ) ;
68-
6953const meta : Meta < typeof DashboardLayout > = {
7054 title : "modules/dashboard/DashboardLayout" ,
7155 component : DashboardLayout ,
@@ -124,57 +108,6 @@ export const ForMember: Story = {
124108 } ,
125109} ;
126110
127- export const CustomOrganizationRoleCanOpenModels : Story = {
128- parameters : {
129- pixel : { matrix : pixelWithDesktop } ,
130- user : MockUserMember ,
131- permissions : MockNoPermissions ,
132- reactRouter : modelSettingsRouter ,
133- queries : [
134- { key : buildInfoKey , data : MockBuildInfo } ,
135- { key : updateCheckQueryKey , data : MockUpdateCheck } ,
136- { key : deploymentStatsQueryKey , data : MockDeploymentStats } ,
137- {
138- key : organizationsPermissions ( [ MockDefaultOrganization . id ] ) . queryKey ,
139- data : {
140- [ MockDefaultOrganization . id ] : {
141- ...MockNoOrganizationPermissions ,
142- viewChatModelConfigs : true ,
143- } ,
144- } ,
145- } ,
146- ] ,
147- } ,
148- play : openModels ,
149- } ;
150-
151- export const ACLReadableMemberCanOpenModels : Story = {
152- parameters : {
153- pixel : { matrix : pixelWithDesktop } ,
154- user : MockUserMember ,
155- permissions : MockNoPermissions ,
156- reactRouter : modelSettingsRouter ,
157- queries : [
158- { key : buildInfoKey , data : MockBuildInfo } ,
159- { key : updateCheckQueryKey , data : MockUpdateCheck } ,
160- { key : deploymentStatsQueryKey , data : MockDeploymentStats } ,
161- {
162- key : chatModels ( MockDefaultOrganization . id ) . queryKey ,
163- data : {
164- models : [
165- {
166- ...MockChatModel ,
167- organization_id : MockDefaultOrganization . id ,
168- } ,
169- ] ,
170- providers : [ MockChatModelProviderDescriptor ] ,
171- } ,
172- } ,
173- ] ,
174- } ,
175- play : openModels ,
176- } ;
177-
178111export const CustomOrganizationRoleCanOpenMCPServers : Story = {
179112 parameters : {
180113 pixel : { matrix : pixelWithDesktop } ,
@@ -243,15 +176,3 @@ export const SkipToMainContent: Story = {
243176 await expect ( main ) . toHaveFocus ( ) ;
244177 } ,
245178} ;
246-
247- async function openModels ( { canvasElement } : { canvasElement : HTMLElement } ) {
248- const user = userEvent . setup ( ) ;
249- const canvas = within ( canvasElement ) ;
250- await expect (
251- canvas . queryByRole ( "button" , { name : "Admin settings" } ) ,
252- ) . not . toBeInTheDocument ( ) ;
253- await user . click ( canvas . getByRole ( "link" , { name : "Models" } ) ) ;
254- await expect (
255- await canvas . findByRole ( "heading" , { name : "Organization models" } ) ,
256- ) . toBeInTheDocument ( ) ;
257- }
0 commit comments