@@ -36,20 +36,20 @@ describe("NewsEditor - Content Editing and Saving", () => {
3636 } )
3737 setMockResponse . get ( urls . userMe . get ( ) , user )
3838
39- const article = factories . websiteContent . websiteContent ( {
39+ const newsItem = factories . websiteContent . websiteContent ( {
4040 id : articleId ,
4141 title,
4242 content,
4343 is_published : false ,
4444 } )
45- setMockResponse . get ( urls . websiteContent . details ( articleId ) , article )
45+ setMockResponse . get ( urls . websiteContent . details ( articleId ) , newsItem )
4646
47- renderWithProviders ( < NewsEditor article = { article } onSave = { mockOnSave } /> , {
47+ renderWithProviders ( < NewsEditor article = { newsItem } onSave = { mockOnSave } /> , {
4848 user,
4949 } )
5050
5151 await screen . findByTestId ( "editor" )
52- return article
52+ return newsItem
5353 }
5454
5555 describe ( "Editing title in banner heading" , ( ) => {
@@ -376,7 +376,7 @@ describe("NewsEditor - Content Editing and Saving", () => {
376376 } )
377377
378378 describe ( "Save as Draft functionality" , ( ) => {
379- test ( "can save article as draft" , async ( ) => {
379+ test ( "can save news as draft" , async ( ) => {
380380 const initialContent : JSONContent = {
381381 type : "doc" ,
382382 content : [
@@ -404,23 +404,23 @@ describe("NewsEditor - Content Editing and Saving", () => {
404404 ] ,
405405 }
406406
407- const article = await setupEditor ( initialContent , 208 , "Title" )
407+ const newsItem = await setupEditor ( initialContent , 208 , "Title" )
408408
409409 const paragraph = screen . getByText ( "Content" )
410410 await userEvent . click ( paragraph )
411411 await userEvent . keyboard ( "{Control>}a{/Control}" )
412412 await userEvent . type ( paragraph , "Updated content" )
413413
414- const updatedArticle = {
415- ...article ,
414+ const updatedNewsItem = {
415+ ...newsItem ,
416416 content : expect . objectContaining ( {
417417 type : "doc" ,
418418 } ) ,
419419 is_published : false ,
420420 }
421421 setMockResponse . patch (
422- urls . websiteContent . details ( article . id ) ,
423- updatedArticle ,
422+ urls . websiteContent . details ( newsItem . id ) ,
423+ updatedNewsItem ,
424424 )
425425
426426 const saveDraftButton = await screen . findByRole ( "button" , {
@@ -433,7 +433,7 @@ describe("NewsEditor - Content Editing and Saving", () => {
433433
434434 expect ( makeRequest ) . toHaveBeenCalledWith (
435435 "patch" ,
436- urls . websiteContent . details ( article . id ) ,
436+ urls . websiteContent . details ( newsItem . id ) ,
437437 expect . objectContaining ( {
438438 is_published : false ,
439439 author_name : "" ,
@@ -505,20 +505,20 @@ describe("NewsEditor - Content Editing and Saving", () => {
505505 } )
506506 } )
507507
508- describe ( "Creating new articles " , ( ) => {
509- test ( "submits article successfully" , async ( ) => {
508+ describe ( "Creating news " , ( ) => {
509+ test ( "submits news successfully" , async ( ) => {
510510 const user = factories . user . user ( {
511511 is_authenticated : true ,
512512 is_article_editor : true ,
513513 } )
514514 setMockResponse . get ( urls . userMe . get ( ) , user )
515515
516- const createdArticle = factories . websiteContent . websiteContent ( {
516+ const createdNewsItem = factories . websiteContent . websiteContent ( {
517517 id : 101 ,
518518 title : "My Article" ,
519519 is_published : true ,
520520 } )
521- setMockResponse . post ( urls . websiteContent . list ( ) , createdArticle )
521+ setMockResponse . post ( urls . websiteContent . list ( ) , createdNewsItem )
522522
523523 renderWithProviders ( < NewsEditor onSave = { mockOnSave } /> , { user } )
524524
@@ -598,7 +598,7 @@ describe("NewsEditor - Content Editing and Saving", () => {
598598
599599 expect ( savedData ) . toBeDefined ( )
600600 expect ( savedData ) . toMatchObject ( {
601- id : createdArticle . id ,
601+ id : createdNewsItem . id ,
602602 title : "My Article" ,
603603 is_published : true ,
604604 } )
@@ -638,20 +638,20 @@ describe("NewsEditor - Document Rendering", () => {
638638 } )
639639 setMockResponse . get ( urls . userMe . get ( ) , user )
640640
641- const article = factories . websiteContent . websiteContent ( {
641+ const newsItem = factories . websiteContent . websiteContent ( {
642642 id : 1 ,
643643 title : "Test Article" ,
644644 content,
645645 } )
646- setMockResponse . get ( urls . websiteContent . details ( articleId ) , article )
646+ setMockResponse . get ( urls . websiteContent . details ( articleId ) , newsItem )
647647
648648 renderWithProviders (
649- < NewsEditor article = { article } onSave = { mockOnSave } readOnly /> ,
649+ < NewsEditor article = { newsItem } onSave = { mockOnSave } readOnly /> ,
650650 { user } ,
651651 )
652652
653653 await screen . findByTestId ( "editor" )
654- return article
654+ return newsItem
655655 }
656656
657657 test ( "renders editor when user has ArticleEditor permission" , async ( ) => {
0 commit comments