Skip to content

ref(js): Convert access.spec to tsx #51106

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -128,9 +128,9 @@ describe('Access', function () {

it('handles no user', function () {
// Regression test for the share sheet.
ConfigStore.config = {
ConfigStore.config = TestStubs.Config({
user: null,
};
});

render(<Access>{childrenMock}</Access>, {context: routerContext, organization});

Expand All @@ -141,9 +141,10 @@ describe('Access', function () {
});

it('is superuser', function () {
ConfigStore.config = {
user: {isSuperuser: true},
};
ConfigStore.config = TestStubs.Config({
user: TestStubs.User({isSuperuser: true}),
});

render(<Access isSuperuser>{childrenMock}</Access>, {
context: routerContext,
organization,
Expand All @@ -156,9 +157,10 @@ describe('Access', function () {
});

it('is not superuser', function () {
ConfigStore.config = {
user: {isSuperuser: false},
};
ConfigStore.config = TestStubs.Config({
user: TestStubs.User({isSuperuser: false}),
});

render(<Access isSuperuser>{childrenMock}</Access>, {
context: routerContext,
organization,
Expand Down Expand Up @@ -195,9 +197,10 @@ describe('Access', function () {
});

it('has superuser', function () {
ConfigStore.config = {
user: {isSuperuser: true},
};
ConfigStore.config = TestStubs.Config({
user: TestStubs.User({isSuperuser: true}),
});

render(
<Access isSuperuser>
<p>The Child</p>
Expand All @@ -209,9 +212,10 @@ describe('Access', function () {
});

it('has no superuser', function () {
ConfigStore.config = {
user: {isSuperuser: false},
};
ConfigStore.config = TestStubs.Config({
user: TestStubs.User({isSuperuser: false}),
});

render(
<Access isSuperuser>
<p>The Child</p>
Expand Down