michael-s-molina commented on a change in pull request #17106:
URL: https://github.com/apache/superset/pull/17106#discussion_r745496348
##########
File path: superset-frontend/src/dashboard/components/Header/Header.test.tsx
##########
@@ -465,4 +465,31 @@ describe('Email Report Modal', () => {
// BLOCKER: I cannot get report to populate, as its data is handled
through redux
expect.anything();
});
+
+ it('Should render report header', async () => {
+ const mockedProps = createProps();
+ render(setup(mockedProps));
+ expect(
+ screen.getByRole('button', { name: 'Schedule email report' }),
+ ).toBeInTheDocument();
+ });
+
+ it('Should not render report header even with menu access for anonymous
user', async () => {
+ const mockedProps = createProps();
+ const anonymousUserProps = {
+ ...mockedProps,
+ user: {
+ roles: {
+ Public: [['menu_access', 'Manage']],
+ },
+ permissions: {
+ datasource_access: ['[examples].[birth_names](id:2)'],
+ },
+ },
+ };
+ render(setup(anonymousUserProps));
+ expect(() =>
+ screen.getByRole('button', { name: 'Schedule email report' }),
+ ).toThrowError('Unable to find');
Review comment:
Can we change this to `queryByRole` and `not.toBeInTheDocument`?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]