Skip to content

Commit

Permalink
[BUGFIX] Réparer le style du pied de page de la mire de connexion (PI…
Browse files Browse the repository at this point in the history
  • Loading branch information
pix-service-auto-merge authored Nov 26, 2024
2 parents b6e46a6 + a94c756 commit 3f2fca6
Show file tree
Hide file tree
Showing 5 changed files with 110 additions and 37 deletions.
20 changes: 15 additions & 5 deletions mon-pix/app/components/authentication-layout/index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -83,15 +83,25 @@
width: 100%;
margin-top: var(--pix-spacing-12x);

.footer-container-content__navigation {
margin-top: var(--pix-spacing-2x);
nav {
@extend %pix-body-xs;

margin-top: var(--pix-spacing-4x);
margin-left: 0;
line-height: 1rem;

a {
@extend %pix-body-xs;
ul {
display: flex;
flex-wrap: wrap;
gap: var(--pix-spacing-2x) var(--pix-spacing-3x);
}

a {
color: var(--pix-neutral-500);
text-decoration: underline;

&:hover, &:focus {
color: var(--pix-primary-500);
}
}

.footer-navigation__item {
Expand Down
13 changes: 8 additions & 5 deletions mon-pix/app/components/footer/footer-links.gjs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { t } from 'ember-intl';
export default class FooterLinks extends Component {
@service url;
@service currentDomain;
@service currentUser;

get shouldDisplayStudentDataProtectionPolicyLink() {
return this.currentDomain.isFranceDomain;
Expand Down Expand Up @@ -56,11 +57,13 @@ export default class FooterLinks extends Component {
</a>
</li>

<li>
<LinkTo @route="authenticated.sitemap">
{{t "navigation.footer.sitemap"}}
</LinkTo>
</li>
{{#if this.currentUser.user}}
<li>
<LinkTo @route="authenticated.sitemap">
{{t "navigation.footer.sitemap"}}
</LinkTo>
</li>
{{/if}}

<li>
<a href="{{this.cguUrl}}" target="_blank" rel="noopener noreferrer">
Expand Down
2 changes: 1 addition & 1 deletion mon-pix/app/styles/components/_footer.scss
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
}

// Footer links
.footer-links__list {
#footer .footer-links__list {
text-align: right;
text-wrap: pretty;

Expand Down
86 changes: 86 additions & 0 deletions mon-pix/tests/integration/components/footer/footer-links-test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
import { render } from '@1024pix/ember-testing-library';
import Service from '@ember/service';
import { hbs } from 'ember-cli-htmlbars';
import { t } from 'ember-intl/test-support';
import { module, test } from 'qunit';

import setupIntlRenderingTest from '../../../helpers/setup-intl-rendering';

module('Integration | Component | Footer', function (hooks) {
setupIntlRenderingTest(hooks);

test('displays a navigation with a list of links', async function (assert) {
// when
const screen = await render(hbs`<Footer::FooterLinks />`);

// then
assert.dom(screen.getByRole('navigation')).hasAttribute('aria-label', t('navigation.footer.label'));

assert.ok(screen.getByRole('link', { name: t('navigation.footer.help-center') }));
assert.ok(screen.getByRole('link', { name: t('navigation.footer.a11y') }));
assert.ok(screen.getByRole('link', { name: t('navigation.footer.server-status') }));
assert.ok(screen.getByRole('link', { name: t('navigation.footer.eula') }));
assert.ok(screen.getByRole('link', { name: t('navigation.footer.legal-notice') }));
assert.ok(screen.getByRole('link', { name: t('navigation.footer.data-protection-policy') }));
});

module('when user is connected', function (hooks) {
hooks.beforeEach(function () {
class CurrentUserStub extends Service {
user = { fullName: 'John Doe' };
}

this.owner.register('service:currentUser', CurrentUserStub);
});

test('displays the sitemap link', async function (assert) {
// when
const screen = await render(hbs`<Footer::FooterLinks />`);

// then
assert.ok(screen.getByRole('link', { name: t('navigation.footer.sitemap') }));
});
});

module('when url does not have frenchDomainExtension', function (hooks) {
hooks.beforeEach(function () {
class CurrentDomainServiceStub extends Service {
get isFranceDomain() {
return false;
}
}

this.owner.register('service:currentDomain', CurrentDomainServiceStub);
});

test('does not display the student data policy', async function (assert) {
// when
const screen = await render(hbs`<Footer />}`);

// then
assert
.dom(screen.queryByRole('link', { name: t('navigation.footer.student-data-protection-policy') }))
.doesNotExist();
});
});

module('when url has frenchDomainExtension', function (hooks) {
hooks.beforeEach(function () {
class CurrentDomainServiceStub extends Service {
get isFranceDomain() {
return true;
}
}

this.owner.register('service:currentDomain', CurrentDomainServiceStub);
});

test('displays the student data policy', async function (assert) {
// when
const screen = await render(hbs`<Footer />}`);

// then
assert.dom(screen.getByRole('link', { name: t('navigation.footer.student-data-protection-policy') })).exists();
});
});
});
26 changes: 0 additions & 26 deletions mon-pix/tests/integration/components/footer/footer-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,6 @@ module('Integration | Component | Footer', function (hooks) {

assert.dom(screen.getByAltText(t('common.pix'))).exists();
assert.dom(screen.getByText(`${t('navigation.copyrights')} ${new Date().getFullYear()} Pix`)).exists();

assert.ok(screen.getByRole('link', { name: t('navigation.footer.help-center') }));
assert.ok(screen.getByRole('link', { name: t('navigation.footer.a11y') }));
assert.ok(screen.getByRole('link', { name: t('navigation.footer.server-status') }));
assert.ok(screen.getByRole('link', { name: t('navigation.footer.sitemap') }));
assert.ok(screen.getByRole('link', { name: t('navigation.footer.eula') }));
assert.ok(screen.getByRole('link', { name: t('navigation.footer.legal-notice') }));
assert.ok(screen.getByRole('link', { name: t('navigation.footer.data-protection-policy') }));
});

module('when url does not have frenchDomainExtension', function (hooks) {
Expand All @@ -54,16 +46,6 @@ module('Integration | Component | Footer', function (hooks) {
// then
assert.dom(screen.queryByAltText(t('common.french-republic'))).doesNotExist();
});

test('does not display the student data policy', async function (assert) {
// when
const screen = await render(hbs`<Footer />}`);

// then
assert
.dom(screen.queryByRole('link', { name: t('navigation.footer.student-data-protection-policy') }))
.doesNotExist();
});
});

module('when url does have frenchDomainExtension', function (hooks) {
Expand All @@ -84,13 +66,5 @@ module('Integration | Component | Footer', function (hooks) {
// then
assert.dom(screen.getByAltText(t('common.french-republic'))).exists();
});

test('displays the student data policy', async function (assert) {
// when
const screen = await render(hbs`<Footer />}`);

// then
assert.dom(screen.getByRole('link', { name: t('navigation.footer.student-data-protection-policy') })).exists();
});
});
});

0 comments on commit 3f2fca6

Please sign in to comment.