-
Notifications
You must be signed in to change notification settings - Fork 18
Me/dpc 5451 last used csp indicator #3015
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
Show all changes
9 commits
Select commit
Hold shift + click to select a range
3c1dc64
CSP cookie saved on successful login. Login screen reads cookie. Lo…
MEspositoE14s ae36d8e
Tests updated
MEspositoE14s 2298709
Merge branch 'main' into me/dpc-5451-last-used-csp-indicator
MEspositoE14s f341b02
Clear Rails asset cache before CI tests
MEspositoE14s 2b21e12
Force asset cache bust before tests
MEspositoE14s 49c1d24
Streamline login page erb
MEspositoE14s 1819ae6
Remove bad comment
MEspositoE14s 3965a34
Coment update
MEspositoE14s a14cc9d
Merge branch 'main' into me/dpc-5451-last-used-csp-indicator
MEspositoE14s File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1 @@ | ||
| <%= render(Page::Session::LoginComponent.new(omniauth_authorize_path(:login_dot_gov))) %> | ||
| <%= render(Page::Session::LoginComponent.new(omniauth_authorize_path(:login_dot_gov), last_used_csp: cookies[:last_used_csp]&.to_sym)) %> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -46,4 +46,61 @@ | |
| expect(page.find_all('.grid-col-12').size).to eq 2 | ||
| end | ||
| end | ||
|
|
||
| describe 'last used csp was CLEAR' do | ||
| let(:url) { '/' } | ||
| let(:component) { described_class.new(url, last_used_csp: :clear) } | ||
| before { render_inline(component) } | ||
|
|
||
| it 'wraps only the CLEAR button' do | ||
| # Check that the right button has the "last used" wrapper. | ||
| expect(page).to have_css('.last-used-login-wrapper .clear-login-button__logo') | ||
|
|
||
| # Make sure the other two don't. | ||
| expect(page).not_to have_css('.last-used-login-wrapper .idme-login-button__logo') | ||
| expect(page).not_to have_css('.last-used-login-wrapper .lg-login-button__logo') | ||
| end | ||
| end | ||
|
|
||
| describe 'last used csp was ID.me' do | ||
| let(:url) { '/' } | ||
| let(:component) { described_class.new(url, last_used_csp: :id_me) } | ||
| before { render_inline(component) } | ||
|
|
||
| it 'wraps only the ID.me button' do | ||
| # Check that the right button has the "last used" wrapper. | ||
| expect(page).to have_css('.last-used-login-wrapper .idme-login-button__logo') | ||
|
|
||
| # Make sure the other two don't. | ||
| expect(page).not_to have_css('.last-used-login-wrapper .clear-login-button__logo') | ||
| expect(page).not_to have_css('.last-used-login-wrapper .lg-login-button__logo') | ||
| end | ||
| end | ||
|
|
||
| describe 'last used csp was Login.gov' do | ||
| let(:url) { '/' } | ||
| let(:component) { described_class.new(url, last_used_csp: :login_dot_gov) } | ||
| before { render_inline(component) } | ||
|
|
||
| it 'wraps only the Login.gov button' do | ||
| # Check that the right button has the "last used" wrapper. | ||
| expect(page).to have_css('.last-used-login-wrapper .lg-login-button__logo') | ||
|
|
||
| # Make sure the other two don't. | ||
| expect(page).not_to have_css('.last-used-login-wrapper .clear-login-button__logo') | ||
| expect(page).not_to have_css('.last-used-login-wrapper .idme-login-button__logo') | ||
| end | ||
|
|
||
| describe 'no last used csp' do | ||
| let(:url) { '/' } | ||
| let(:component) { described_class.new(url, last_used_csp: nil) } | ||
| before { render_inline(component) } | ||
|
|
||
| it "doesn't wrap any buttons" do | ||
| expect(page).not_to have_css('.last-used-login-wrapper .clear-login-button__logo') | ||
| expect(page).not_to have_css('.last-used-login-wrapper .idme-login-button__logo') | ||
| expect(page).not_to have_css('.last-used-login-wrapper .lg-login-button__logo') | ||
| end | ||
| end | ||
| end | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 👍 |
||
| end | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added this because the asset cache isn't getting rebuilt between CI runs on our code builders, and it causes tests to fail whenever we need to add an image somewhere. This forces it in CI.