@@ -4,7 +4,7 @@ import { MemoryRouter } from 'react-router-dom'
4
4
import { RecoilRoot } from 'recoil'
5
5
import { managedClusterAddonsState } from '../../../../atoms'
6
6
import { nockGet , nockIgnoreApiPaths } from '../../../../lib/nock-util'
7
- import { waitForNocks , waitForText } from '../../../../lib/test-util'
7
+ import { waitForNocks , waitForText , waitForNotText } from '../../../../lib/test-util'
8
8
import { ManagedClusterAddOn } from '../../../../resources'
9
9
import { PolicyTemplateDetails } from './PolicyTemplateDetails'
10
10
@@ -607,11 +607,11 @@ describe('Policy Template Details content', () => {
607
607
)
608
608
} )
609
609
610
- test ( 'Should render correctly with relatedObject name is * when it is cluster scope' , async ( ) => {
610
+ test ( 'Should render correctly with relatedObject name is - when it is cluster scope' , async ( ) => {
611
611
const replaceRelatedObj = [
612
612
{
613
613
compliant : 'NonCompliant' ,
614
- object : { apiVersion : 'v1' , kind : 'Namespace' , metadata : { name : '* ' } } ,
614
+ object : { apiVersion : 'v1' , kind : 'Namespace' , metadata : { name : '- ' } } ,
615
615
reason : 'Resource found as expected' ,
616
616
cluster : 'test-cluster' ,
617
617
} ,
@@ -643,19 +643,17 @@ describe('Policy Template Details content', () => {
643
643
644
644
// wait for related resources table to load correctly
645
645
await waitForText ( 'Related resources' )
646
- await waitForText ( '*' )
646
+ // Both namespace and name
647
+ await waitForText ( '-' , true )
647
648
await waitForText ( 'v1' )
648
- const viewYamlLink = screen . getByText ( 'View YAML' )
649
- expect ( viewYamlLink . getAttribute ( 'href' ) ) . toEqual (
650
- `/multicloud/home/search/resources/yaml?cluster=test-cluster&kind=Namespace&apiversion=v1`
651
- )
649
+ await waitForNotText ( 'View YAML' )
652
650
} )
653
651
654
- test ( 'Should render correctly with relatedObject name is * when it is namespace scope' , async ( ) => {
652
+ test ( 'Should render correctly with relatedObject name is - when it is namespace scope' , async ( ) => {
655
653
const replaceRelatedObj = [
656
654
{
657
655
compliant : 'NonCompliant' ,
658
- object : { apiVersion : 'networking.k8s.io/v1' , kind : 'Ingress' , metadata : { namespace : 'ohmyns' , name : '* ' } } ,
656
+ object : { apiVersion : 'networking.k8s.io/v1' , kind : 'Ingress' , metadata : { namespace : 'ohmyns' , name : '- ' } } ,
659
657
reason : 'Resource found as expected' ,
660
658
cluster : 'test-cluster' ,
661
659
} ,
@@ -687,11 +685,8 @@ describe('Policy Template Details content', () => {
687
685
688
686
// wait for related resources table to load correctly
689
687
await waitForText ( 'Related resources' )
690
- await waitForText ( '* ' )
688
+ await waitForText ( '- ' )
691
689
await waitForText ( 'networking.k8s.io/v1' )
692
- const viewYamlLink = screen . getByText ( 'View YAML' )
693
- expect ( viewYamlLink . getAttribute ( 'href' ) ) . toEqual (
694
- `/multicloud/home/search/resources/yaml?cluster=test-cluster&kind=Ingress&apiversion=networking.k8s.io/v1&namespace=ohmyns`
695
- )
690
+ await waitForNotText ( 'View YAML' )
696
691
} )
697
692
} )
0 commit comments