File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ import * as React from "react";
33import { Meta , StoryFn } from "@storybook/react" ;
44
55import { MethodModeling as MethodModelingComponent } from "../../view/method-modeling/MethodModeling" ;
6+ import { createMethod } from "../../../test/factories/data-extension/method-factories" ;
67export default {
78 title : "Method Modeling/Method Modeling" ,
89 component : MethodModelingComponent ,
@@ -12,11 +13,23 @@ const Template: StoryFn<typeof MethodModelingComponent> = (args) => (
1213 < MethodModelingComponent { ...args } />
1314) ;
1415
16+ const method = createMethod ( ) ;
17+
1518export const MethodUnmodeled = Template . bind ( { } ) ;
16- MethodUnmodeled . args = { modelingStatus : "unmodeled" } ;
19+ MethodUnmodeled . args = {
20+ method,
21+ modelingStatus : "unmodeled" ,
22+ } ;
1723
1824export const MethodModeled = Template . bind ( { } ) ;
19- MethodModeled . args = { modelingStatus : "unsaved" } ;
25+ MethodModeled . args = {
26+ method,
27+
28+ modelingStatus : "unsaved" ,
29+ } ;
2030
2131export const MethodSaved = Template . bind ( { } ) ;
22- MethodSaved . args = { modelingStatus : "saved" } ;
32+ MethodSaved . args = {
33+ method,
34+ modelingStatus : "saved" ,
35+ } ;
Original file line number Diff line number Diff line change @@ -8,19 +8,26 @@ import { Method } from "../../model-editor/method";
88import { MethodName } from "../model-editor/MethodName" ;
99
1010const Container = styled . div `
11- background-color: var(--vscode-peekViewResult-background);
1211 padding: 0.3rem;
1312 margin-bottom: 1rem;
13+ width: 100%;
1414` ;
1515
1616const Title = styled . div `
1717 padding-bottom: 0.3rem;
18- font-size: 1.2em;
18+ font-size: 0.7rem;
19+ text-transform: uppercase;
1920` ;
2021
2122const DependencyContainer = styled . div `
2223 display: flex;
23- justify-content: space-between;
24+ flex-direction: row;
25+ align-items: center;
26+ gap: 0.5em;
27+ background-color: var(--vscode-textBlockQuote-background);
28+ border-radius: 0.3rem;
29+ border-color: var(--vscode-textBlockQuote-border);
30+ padding: 0.5rem;
2431` ;
2532
2633export type MethodModelingProps = {
@@ -34,10 +41,13 @@ export const MethodModeling = ({
3441} : MethodModelingProps ) : JSX . Element => {
3542 return (
3643 < Container >
37- < Title > API or Method</ Title >
44+ < Title >
45+ { method . packageName }
46+ { method . libraryVersion && < > @{ method . libraryVersion } </ > }
47+ </ Title >
3848 < DependencyContainer >
39- < MethodName { ...method } />
4049 < ModelingStatusIndicator status = { modelingStatus } />
50+ < MethodName { ...method } />
4151 </ DependencyContainer >
4252 </ Container >
4353 ) ;
Original file line number Diff line number Diff line change @@ -8,11 +8,15 @@ describe(MethodModeling.name, () => {
88 reactRender ( < MethodModeling { ...props } /> ) ;
99
1010 it ( "renders method modeling panel" , ( ) => {
11+ const method = createMethod ( ) ;
12+
1113 render ( {
1214 modelingStatus : "saved" ,
13- method : createMethod ( ) ,
15+ method,
1416 } ) ;
1517
16- expect ( screen . getByText ( "API or Method" ) ) . toBeInTheDocument ( ) ;
18+ expect (
19+ screen . getByText ( `${ method . packageName } @${ method . libraryVersion } ` ) ,
20+ ) . toBeInTheDocument ( ) ;
1721 } ) ;
1822} ) ;
You can’t perform that action at this time.
0 commit comments