@@ -3,7 +3,7 @@ import { render, screen } from '@testing-library/react';
33import { StudentComponent } from './student.component' ;
44
55describe ( 'StudentComponent tests' , ( ) => {
6- it ( 'It should show the session name and the text' , ( ) => {
6+ it ( 'It should show the session name and the text when passing valid parameters ' , ( ) => {
77 // Arrange
88 const props = {
99 room : 'Room I' ,
@@ -40,7 +40,7 @@ describe('StudentComponent tests', () => {
4040 expect ( sessionName ) . toHaveTextContent ( expectedSessionNameText ) ;
4141 } ) ;
4242
43- it ( 'It should show an empty session name when passing null' , ( ) => {
43+ it ( 'It should show an empty session name when passing a null room value ' , ( ) => {
4444 // Arrange
4545 const props = {
4646 room : null ,
@@ -58,15 +58,13 @@ describe('StudentComponent tests', () => {
5858 expect ( sessionName ) . toHaveTextContent ( expectedSessionNameText ) ;
5959 } ) ;
6060
61- it ( 'It should empty text when passing undefined' , ( ) => {
61+ it ( 'It should show an empty text when passing an undefined log value ' , ( ) => {
6262 // Arrange
6363 const props = {
6464 room : 'Room I' ,
6565 log : undefined ,
6666 } ;
6767
68- const expectedSessionNameText = `Session name: ${ props . room } ` ;
69-
7068 // Act
7169 render ( < StudentComponent { ...props } /> ) ;
7270
@@ -75,15 +73,13 @@ describe('StudentComponent tests', () => {
7573 expect ( textArea ) . toHaveTextContent ( '' ) ;
7674 } ) ;
7775
78- it ( 'It should empty text when passing null' , ( ) => {
76+ it ( 'It should show an empty text when passing a null log value ' , ( ) => {
7977 // Arrange
8078 const props = {
8179 room : 'Room I' ,
82- log : undefined ,
80+ log : null ,
8381 } ;
8482
85- const expectedSessionNameText = `Session name: ${ props . room } ` ;
86-
8783 // Act
8884 render ( < StudentComponent { ...props } /> ) ;
8985
0 commit comments