Skip to content
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 e2e-tests/cypress/e2e/owner/language.cy.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// The suite runs with a French browser: an English page can only come from the language the app passes.
function visitHomeWithLanguage(lang: "fr" | "en") {
cy.visit(Cypress.env("ownerUrl") + "/home", {
cy.visit(Cypress.expose("ownerUrl") + "/home", {
onBeforeLoad: (win) => {
win.document.cookie = `lang=${lang}; path=/`;
},
Expand Down
16 changes: 10 additions & 6 deletions e2e-tests/cypress/e2e/tenant/language.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@ function visitWithLanguage(url: string, lang: "fr" | "en") {

describe("language passed to the tenant login page and to the main site's sign-up links", () => {
it("shows the login page in English when the tenant app is in English", () => {
visitWithLanguage(Cypress.env("tenantUrl") + "/login", "en");
visitWithLanguage(Cypress.expose("tenantUrl") + "/login", "en");
cy.get('input[name="username"]').should("be.visible");
cy.location("search").should("include", "ui_locales=en");
cy.get("html").should("have.attr", "lang", "en");
});

it("lets the login page follow the browser when the tenant app is in French", () => {
visitWithLanguage(Cypress.env("tenantUrl") + "/login", "fr");
visitWithLanguage(Cypress.expose("tenantUrl") + "/login", "fr");
cy.get('input[name="username"]').should("be.visible");
cy.location("search").should("not.include", "ui_locales");
cy.get("html").should("have.attr", "lang", "fr");
Expand All @@ -23,19 +23,23 @@ describe("language passed to the tenant login page and to the main site's sign-u
// The pages of the main site that have a sign-up button or link.
for (const page of ["/", "/partenaires", "/blog/locatio-devient-dossier-facile", "/plan-du-site"]) {
it(`gives every sign-up link of the main site's ${page} page the site's language`, () => {
visitWithLanguage(Cypress.env("mainUrl") + page, "en");
visitWithLanguage(Cypress.expose("mainUrl") + page, "en");
cy.get('a[href*="/registrations"]').should(($links) => {
expect($links).to.have.length.greaterThan(0);
$links.each((_, link) => expect(link.getAttribute("href")).to.include("ui_locales=en"));
$links.each((_, link) => {
expect(link.getAttribute("href")).to.include("ui_locales=en");
});
});

// A first visit: the site starts in French and stores it once it runs.
cy.clearLocalStorage();
cy.visit(Cypress.env("mainUrl") + page);
cy.visit(Cypress.expose("mainUrl") + page);
cy.window().its("localStorage.lang").should("equal", "fr");
cy.get('a[href*="/registrations"]').should(($links) => {
expect($links).to.have.length.greaterThan(0);
$links.each((_, link) => expect(link.getAttribute("href")).not.to.include("ui_locales"));
$links.each((_, link) => {
expect(link.getAttribute("href")).not.to.include("ui_locales");
});
});
});
}
Expand Down
1 change: 1 addition & 0 deletions tenantv3/src/components/analysis/AnalysisErrorBlock.vue
Original file line number Diff line number Diff line change
Expand Up @@ -310,6 +310,7 @@ defineExpose({
}

.separator-text {
margin: 0;
font-weight: 700;
font-size: 0.875rem;
color: var(--text-title-grey);
Expand Down
1 change: 1 addition & 0 deletions tenantv3/src/components/analysis/AnalysisWrapper.vue
Original file line number Diff line number Diff line change
Expand Up @@ -593,6 +593,7 @@ function beforeSubmit(): boolean {
}

.separator-text {
margin: 0;
font-weight: 700;
font-size: 1.25rem;
line-height: 1.75rem;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -207,9 +207,7 @@ for (const viewport of [
'.tax-analysis-guidance a[href="/nom-locataire"]'
)
await expect.element(nameLink).toBeVisible()
await userEvent.click(
main.querySelector<HTMLElement>('.tax-analysis-guidance button.fr-link')!
)
await userEvent.click(main.querySelector<HTMLElement>('.tax-analysis-guidance button')!)
const dialog = page.getByRole('dialog')
await expect.element(dialog).toBeVisible()
expect(dialog.element().matches('dialog:modal')).toBe(true)
Expand Down
2 changes: 1 addition & 1 deletion tenantv3/src/components/tax/lib/TaxAnalysisGuidance.vue
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
"
>
<a
href="https://www.impots.gouv.fr/particulier/questions/jai-perdu-mon-avis-dimpot-sur-le-revenu-puis-je-en-obtenir-une-copie"
href="https://aide.dossierfacile.logement.gouv.fr/fr/article/avis-dimposition-francais-13htlj7/#1-ii-comment-telecharger-le-document-avis-dimpot-sur-les-revenus"
target="_blank"
rel="noopener noreferrer"
:title="`${t('download-help')} - ${t('new-window')}`"
Expand Down
11 changes: 10 additions & 1 deletion tenantv3/src/components/tax/lib/TaxBackLinkRow.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
<template>
<template v-if="inline">
<button v-if="hasDocument" type="button" class="fr-link" @click="onEdit">{{ label }}</button>
<button v-if="hasDocument" type="button" class="inline-link" @click="onEdit">
<span class="btn-link">{{ label }}</span>
</button>
<RouterLink v-else :to>{{ label }}</RouterLink>
</template>
<BackLinkRow v-else :to :is-button="hasDocument" :label="label" @edit="onEdit" />
Expand Down Expand Up @@ -46,3 +48,10 @@ const confirm = async () => {
router.push(props.to)
}
</script>

<style scoped>
.inline-link {
padding: 0;
text-align: left;
}
</style>