@@ -49,11 +49,11 @@ describe('agents/brand-profile', () => {
4949 } ) ;
5050 const createFrom = sandbox . stub ( ) . returns ( { fetchChatCompletion } ) ;
5151
52- const mod = await esmock ( '../../../../ src/tasks /agents/brand-profile/index.js' , {
52+ const mod = await esmock ( '../../../src/agents/brand-profile/index.js' , {
5353 '@adobe/spacecat-shared-gpt-client' : {
5454 AzureOpenAIClient : { createFrom } ,
5555 } ,
56- '../../../../ src/tasks /agents/base.js' : {
56+ '../../../src/agents/base.js' : {
5757 readPromptFile : sandbox . stub ( )
5858 . onFirstCall ( )
5959 . returns ( 'SYS_PROMPT' )
@@ -78,8 +78,8 @@ describe('agents/brand-profile', () => {
7878 } ) ;
7979
8080 it ( 'run() throws on invalid baseURL' , async ( ) => {
81- const mod = await esmock ( '../../../../ src/tasks /agents/brand-profile/index.js' , {
82- '../../../../ src/tasks /agents/base.js' : {
81+ const mod = await esmock ( '../../../src/agents/brand-profile/index.js' , {
82+ '../../../src/agents/base.js' : {
8383 readPromptFile : sandbox . stub ( ) ,
8484 renderTemplate : sandbox . stub ( ) ,
8585 } ,
@@ -94,11 +94,11 @@ describe('agents/brand-profile', () => {
9494 } ) ;
9595 const createFrom = sandbox . stub ( ) . returns ( { fetchChatCompletion } ) ;
9696
97- const mod = await esmock ( '../../../../ src/tasks /agents/brand-profile/index.js' , {
97+ const mod = await esmock ( '../../../src/agents/brand-profile/index.js' , {
9898 '@adobe/spacecat-shared-gpt-client' : {
9999 AzureOpenAIClient : { createFrom } ,
100100 } ,
101- '../../../../ src/tasks /agents/base.js' : {
101+ '../../../src/agents/base.js' : {
102102 readPromptFile : sandbox . stub ( )
103103 . onFirstCall ( )
104104 . returns ( 'SYS_PROMPT' )
@@ -119,11 +119,11 @@ describe('agents/brand-profile', () => {
119119 } ) ;
120120 const createFrom = sandbox . stub ( ) . returns ( { fetchChatCompletion } ) ;
121121
122- const mod = await esmock ( '../../../../ src/tasks /agents/brand-profile/index.js' , {
122+ const mod = await esmock ( '../../../src/agents/brand-profile/index.js' , {
123123 '@adobe/spacecat-shared-gpt-client' : {
124124 AzureOpenAIClient : { createFrom } ,
125125 } ,
126- '../../../../ src/tasks /agents/base.js' : {
126+ '../../../src/agents/base.js' : {
127127 readPromptFile : sandbox . stub ( )
128128 . onFirstCall ( )
129129 . returns ( 'SYS_PROMPT' )
@@ -142,20 +142,20 @@ describe('agents/brand-profile', () => {
142142 } ) ;
143143
144144 it ( 'persist() returns early for invalid siteId' , async ( ) => {
145- const mod = await esmock ( '../../../../ src/tasks /agents/brand-profile/index.js' , { } ) ;
145+ const mod = await esmock ( '../../../src/agents/brand-profile/index.js' , { } ) ;
146146
147147 await mod . default . persist (
148- { context : { siteId : 'invalid' } } ,
148+ { siteId : 'invalid' } ,
149149 context ,
150150 { ok : true } ,
151151 ) ;
152152 expect ( log . warn ) . to . have . been . calledWith ( sinon . match ( 'brand-profile persist: invalid siteId' ) ) ;
153153 } ) ;
154154
155155 it ( 'persist() returns early for empty result' , async ( ) => {
156- const mod = await esmock ( '../../../../ src/tasks /agents/brand-profile/index.js' , { } ) ;
156+ const mod = await esmock ( '../../../src/agents/brand-profile/index.js' , { } ) ;
157157 await mod . default . persist (
158- { context : { siteId : '123e4567-e89b-12d3-a456-426614174000' } } ,
158+ { siteId : '123e4567-e89b-12d3-a456-426614174000' } ,
159159 context ,
160160 { } ,
161161 ) ;
@@ -166,9 +166,9 @@ describe('agents/brand-profile', () => {
166166 const findById = sandbox . stub ( ) . resolves ( null ) ;
167167 context . dataAccess . Site = { findById } ;
168168
169- const mod = await esmock ( '../../../../ src/tasks /agents/brand-profile/index.js' , { } ) ;
169+ const mod = await esmock ( '../../../src/agents/brand-profile/index.js' , { } ) ;
170170 await mod . default . persist (
171- { context : { siteId : '123e4567-e89b-12d3-a456-426614174000' } } ,
171+ { siteId : '123e4567-e89b-12d3-a456-426614174000' } ,
172172 context ,
173173 { ok : true } ,
174174 ) ;
@@ -195,14 +195,14 @@ describe('agents/brand-profile', () => {
195195 context . dataAccess . Site = { findById } ;
196196
197197 const toDynamoItem = sandbox . stub ( ) . callsFake ( ( c ) => c ) ;
198- const mod = await esmock ( '../../../../ src/tasks /agents/brand-profile/index.js' , {
198+ const mod = await esmock ( '../../../src/agents/brand-profile/index.js' , {
199199 '@adobe/spacecat-shared-data-access/src/models/site/config.js' : {
200200 Config : { toDynamoItem } ,
201201 } ,
202202 } ) ;
203203
204204 await mod . default . persist (
205- { context : { siteId : '123e4567-e89b-12d3-a456-426614174000' , baseURL : 'https://example.com' } } ,
205+ { siteId : '123e4567-e89b-12d3-a456-426614174000' , baseURL : 'https://example.com' } ,
206206 context ,
207207 { any : 'result' } ,
208208 ) ;
@@ -230,14 +230,14 @@ describe('agents/brand-profile', () => {
230230 context . dataAccess . Site = { findById } ;
231231
232232 const toDynamoItem = sandbox . stub ( ) . callsFake ( ( c ) => c ) ;
233- const mod = await esmock ( '../../../../ src/tasks /agents/brand-profile/index.js' , {
233+ const mod = await esmock ( '../../../src/agents/brand-profile/index.js' , {
234234 '@adobe/spacecat-shared-data-access/src/models/site/config.js' : {
235235 Config : { toDynamoItem } ,
236236 } ,
237237 } ) ;
238238
239239 await mod . default . persist (
240- { context : { siteId : '123e4567-e89b-12d3-a456-426614174000' , baseURL : 'https://example.com' } } ,
240+ { siteId : '123e4567-e89b-12d3-a456-426614174000' , baseURL : 'https://example.com' } ,
241241 context ,
242242 { unchanged : true } ,
243243 ) ;
@@ -267,14 +267,14 @@ describe('agents/brand-profile', () => {
267267 context . dataAccess . Site = { findById } ;
268268
269269 const toDynamoItem = sandbox . stub ( ) . callsFake ( ( c ) => c ) ;
270- const mod = await esmock ( '../../../../ src/tasks /agents/brand-profile/index.js' , {
270+ const mod = await esmock ( '../../../src/agents/brand-profile/index.js' , {
271271 '@adobe/spacecat-shared-data-access/src/models/site/config.js' : {
272272 Config : { toDynamoItem } ,
273273 } ,
274274 } ) ;
275275
276276 await mod . default . persist (
277- { context : { siteId : '123e4567-e89b-12d3-a456-426614174000' } } ,
277+ { siteId : '123e4567-e89b-12d3-a456-426614174000' } ,
278278 context ,
279279 { foo : 'bar' } ,
280280 ) ;
0 commit comments