@@ -126,11 +126,7 @@ test('renders a default list of nodes in the primary section if seedNode is not
126126 await waitFor ( ( ) => queryByAttribute ( 'id' , dom . container , 'wpadminbar' ) ) ;
127127 const toolBars = screen . getAllByRole ( 'list' , { name : / t o o l b a r / i } ) ;
128128 // Primary Toolbar
129- testToolBarNode (
130- toolBars [ 0 ] ,
131- 3 ,
132- [ 'WordPress' , '' , 'GraphiQL IDE' ] ,
133- ) ;
129+ testToolBarNode ( toolBars [ 0 ] , 3 , [ 'WordPress' , '' , 'GraphiQL IDE' ] ) ;
134130} ) ;
135131
136132test ( 'renders an Edit Post Node, in the primary section if seedNode is provided' , async ( ) => {
@@ -150,11 +146,7 @@ test('renders an Edit Post Node, in the primary section if seedNode is provided
150146 await waitFor ( ( ) => queryByAttribute ( 'id' , dom . container , 'wpadminbar' ) ) ;
151147 const toolBars = screen . getAllByRole ( 'list' , { name : / t o o l b a r / i } ) ;
152148 // Primary Toolbar
153- testToolBarNode (
154- toolBars [ 0 ] ,
155- 3 ,
156- [ 'WordPress' , 'Edit Post' , 'GraphiQL IDE' ] ,
157- ) ;
149+ testToolBarNode ( toolBars [ 0 ] , 3 , [ 'WordPress' , 'Edit Post' , 'GraphiQL IDE' ] ) ;
158150} ) ;
159151
160152test ( 'renders an Account Node in the secondary section' , async ( ) => {
@@ -172,11 +164,12 @@ test('renders an Account Node in the secondary section', async () => {
172164 await waitFor ( ( ) => queryByAttribute ( 'id' , dom . container , 'wpadminbar' ) ) ;
173165 const toolBars = screen . getAllByRole ( 'list' , { name : / t o o l b a r / i } ) ;
174166 // Secondary Toolbar
175- testToolBarNode (
176- toolBars [ 1 ] ,
177- 4 ,
178- [ 'Howdy, Edit ProfileLog Out' , '' , 'Edit Profile' , 'Log Out' ] ,
179- ) ;
167+ testToolBarNode ( toolBars [ 1 ] , 4 , [
168+ 'Howdy, Edit ProfileLog Out' ,
169+ '' ,
170+ 'Edit Profile' ,
171+ 'Log Out' ,
172+ ] ) ;
180173} ) ;
181174
182175test ( 'renders an Edit Post Node, if seedNode is not provided and is preview' , async ( ) => {
@@ -196,11 +189,7 @@ test('renders an Edit Post Node, if seedNode is not provided and is preview', as
196189 await waitFor ( ( ) => queryByAttribute ( 'id' , dom . container , 'wpadminbar' ) ) ;
197190 const toolBars = screen . getAllByRole ( 'list' , { name : / t o o l b a r / i } ) ;
198191 // Primary Toolbar
199- testToolBarNode (
200- toolBars [ 0 ] ,
201- 3 ,
202- [ 'WordPress' , 'Edit Post' , 'GraphiQL IDE' ] ,
203- ) ;
192+ testToolBarNode ( toolBars [ 0 ] , 3 , [ 'WordPress' , 'Edit Post' , 'GraphiQL IDE' ] ) ;
204193} ) ;
205194
206195test ( 'does not render an Edit Post Node, if there is no seedNode and it is not a preview' , async ( ) => {
@@ -216,11 +205,7 @@ test('does not render an Edit Post Node, if there is no seedNode and it is not a
216205 await waitFor ( ( ) => queryByAttribute ( 'id' , dom . container , 'wpadminbar' ) ) ;
217206 const toolBars = screen . getAllByRole ( 'list' , { name : / t o o l b a r / i } ) ;
218207 // Primary Toolbar
219- testToolBarNode (
220- toolBars [ 0 ] ,
221- 3 ,
222- [ 'WordPress' , '' , 'GraphiQL IDE' ] ,
223- ) ;
208+ testToolBarNode ( toolBars [ 0 ] , 3 , [ 'WordPress' , '' , 'GraphiQL IDE' ] ) ;
224209} ) ;
225210
226211test ( 'Uses `toolbarNodes` hook to add nodes' , async ( ) => {
@@ -246,11 +231,12 @@ test('Uses `toolbarNodes` hook to add nodes', async () => {
246231 await waitFor ( ( ) => queryByAttribute ( 'id' , dom . container , 'wpadminbar' ) ) ;
247232 const toolBars = screen . getAllByRole ( 'list' , { name : / t o o l b a r / i } ) ;
248233 // Primary Toolbar
249- testToolBarNode (
250- toolBars [ 0 ] ,
251- 4 ,
252- [ 'WordPress' , 'Edit Post' , 'GraphiQL IDE' , 'Test Node' ] ,
253- ) ;
234+ testToolBarNode ( toolBars [ 0 ] , 4 , [
235+ 'WordPress' ,
236+ 'Edit Post' ,
237+ 'GraphiQL IDE' ,
238+ 'Test Node' ,
239+ ] ) ;
254240} ) ;
255241
256242class TestAddToolbarNodePlugin {
0 commit comments