Skip to content
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

jeremy/GITC-574/grants explorer routing change #9663

Merged
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion app/dashboard/templates/shared/menu.html
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@
<b class="gc-menu-submenu-title d-none d-md-block px-3 pt-3 pb-2">{% trans "Grants" %}</b>
<ul class="list-unstyled">
<li>
<a class="dropdown-item dropdown-item-small" href="{% url 'grants:grants' %}">{% trans "Explore Grants" %}</a>
<a class="dropdown-item dropdown-item-small" href="{% url 'grants:grants_explorer' %}">{% trans "Explore Grants" %}</a>
</li>
<li>
<a class="dropdown-item dropdown-item-small" href="{% url 'grants:new' %}">{% trans "Create Grant" %}</a>
Expand Down
25 changes: 25 additions & 0 deletions cypress/integration/landing_page/test_products_menu.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
describe('Products menu', () => {
before(() => {
cy.setupMetamask();
});

beforeEach(() => {
cy.impersonateUser();
});

afterEach(() => {
cy.logout();
});
Comment on lines +6 to +12
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

are these needed for this test?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think the afterEach is necessary, but we definitely need the impersonateUser

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you have to log in for this page, then you will need to make sure to log out after the test. If you need the impersonateUser then keep the logout. Cypress will keep that user in session and it could cause state issues for the next test. I expected the grants page to be public.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah that makes sense. I'll put it back, but I just tested it on the production site, and the pages are public. The test breaks without impersonateUser() though.


after(() => {
cy.clearWindows();
});

it('navigates to the grants explorer when \'Explore Grants\' is selected', () => {
cy.get('#dropdownProducts').trigger('mouseenter');
cy.contains('Grants Crowdfunding for Open Source').trigger('mouseenter');
cy.contains('Explore Grants').click();

cy.url().should('contain', 'grants/explorer');
});
});