1
1
import { OrganizationFixture } from 'sentry-fixture/organization' ;
2
2
import { ProjectFixture } from 'sentry-fixture/project' ;
3
- import { RouteComponentPropsFixture } from 'sentry-fixture/routeComponentPropsFixture' ;
4
3
5
4
import { render , screen } from 'sentry-test/reactTestingLibrary' ;
6
5
import selectEvent from 'sentry-test/selectEvent' ;
7
6
8
7
import ProjectsStore from 'sentry/stores/projectsStore' ;
9
- import { DiscoverLanding } from 'sentry/views/discover/landing' ;
8
+ import DiscoverLanding from 'sentry/views/discover/landing' ;
9
+
10
+ import { OrganizationContext } from '../organizationContext' ;
10
11
11
12
describe ( 'Discover > Landing' , function ( ) {
12
13
const eventTitle = 'Oh no something bad' ;
@@ -73,20 +74,19 @@ describe('Discover > Landing', function () {
73
74
} ) ;
74
75
75
76
it ( 'denies access on missing feature' , function ( ) {
76
- render (
77
- < DiscoverLanding
78
- organization = { OrganizationFixture ( ) }
79
- { ...RouteComponentPropsFixture ( ) }
80
- />
81
- ) ;
77
+ render ( < DiscoverLanding /> ) ;
82
78
83
79
expect ( screen . getByText ( "You don't have access to this feature" ) ) . toBeInTheDocument ( ) ;
84
80
} ) ;
85
81
86
82
it ( 'has the right sorts' , async function ( ) {
87
83
const org = OrganizationFixture ( { features} ) ;
88
84
89
- render ( < DiscoverLanding organization = { org } { ...RouteComponentPropsFixture ( ) } /> ) ;
85
+ render (
86
+ < OrganizationContext . Provider value = { org } >
87
+ < DiscoverLanding />
88
+ </ OrganizationContext . Provider >
89
+ ) ;
90
90
91
91
const expectedSorts = [
92
92
'My Queries' ,
@@ -111,7 +111,11 @@ describe('Discover > Landing', function () {
111
111
it ( 'links back to the homepage' , async ( ) => {
112
112
const org = OrganizationFixture ( { features} ) ;
113
113
114
- render ( < DiscoverLanding organization = { org } { ...RouteComponentPropsFixture ( ) } /> ) ;
114
+ render (
115
+ < OrganizationContext . Provider value = { org } >
116
+ < DiscoverLanding />
117
+ </ OrganizationContext . Provider >
118
+ ) ;
115
119
116
120
expect ( await screen . findByText ( 'Discover' ) ) . toHaveAttribute (
117
121
'href' ,
0 commit comments