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

1090 add default casa logo #1144

Merged
merged 5 commits into from
Oct 21, 2020
Merged

Conversation

RachelWyatt
Copy link
Collaborator

What github issue is this PR for, if any?

Resolves #1090

What changed, and why?

For organizations without a set logo, the sidebar will now display the default CASA logo.

How will this affect user permissions?

No change to permissions.

How is this tested? (please write tests!) 💖💪

  • Tests added in spec/system/admin_views_volunteers_page_spec.rb and spec/views/layouts/sidebar.html.erb_spec.rb to ensure xpath to default-logo is present on page
  • Let me know if there are any thoughts on where/how to test this and I can add those in

Screenshots please :)

View before change (logged in as other_casa_admin@example.com, but this will also change supervisor and volunteer views):
Screen Shot 2020-10-20 at 9 36 33 AM

View after change:
Screen Shot 2020-10-20 at 9 35 59 AM

Feelings gif (optional)

happy dance

@github-actions github-actions bot added ruby Pull requests that update Ruby code Tests! 🎉💖👏 labels Oct 20, 2020
@RachelWyatt RachelWyatt changed the title Rachelwyatt/1090 add default casa logo 1090 add default casa logo Oct 20, 2020

visit volunteers_path

expect(page).to have_xpath("//img[@src = '/packs-test/media/src/images/default-logo-c9048fc43854499e952e4b62a505bf35.png' and @alt='CASA Logo']")
Copy link
Collaborator

Choose a reason for hiding this comment

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

I don't think that this hash will stay the same over time? But maybe it will?
'/packs-test/media/src/images/default-logo-c9048fc43854499e952e4b62a505bf35.png

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I think this hash will stay the same since we're on webpacker v 5.2, which uses contenthash instead of chunkhash to generate this -- it should be 100% based on the file contents.

webpack/webpack.js.org#2096

That said, I'm happy to update this to just look for 'default-logo' so the test is more resilient :)

Copy link
Collaborator

Choose a reason for hiding this comment

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

Let's leave it as is and if it breaks then we'll change it :)

Copy link
Collaborator

@compwron compwron left a comment

Choose a reason for hiding this comment

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

:)

@compwron compwron merged commit 0ac81b1 into master Oct 21, 2020
@compwron compwron deleted the rachelwyatt/1090-add-default-casa-logo branch October 21, 2020 07:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ruby Pull requests that update Ruby code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

casa_org without custom logo displays neutral CASA logo by default
2 participants