Merge branch 'test/fix-cypress' into 'master'

Fix Cypress tests and add a different welcome message when coming from registration

See merge request framasoft/mobilizon!270
This commit is contained in:
Thomas Citharel 2019-10-15 17:51:45 +02:00
commit d755589c9d
7 changed files with 24 additions and 12 deletions

View File

@ -159,7 +159,6 @@
"No events found": "No events found", "No events found": "No events found",
"No group found": "No group found", "No group found": "No group found",
"No groups found": "No groups found", "No groups found": "No groups found",
"No participants yet": "No participants yet",
"No results for \"{queryText}\"": "No results for \"{queryText}\"", "No results for \"{queryText}\"": "No results for \"{queryText}\"",
"Number of places": "Number of places", "Number of places": "Number of places",
"OK": "OK", "OK": "OK",
@ -283,9 +282,10 @@
"We want to develop a <b>digital common</b>, that everyone can make their own, which respects <b>privacy and activism by design</b>.": "We want to develop a <b>digital common</b>, that everyone can make their own, which respects <b>privacy and activism by design</b>.", "We want to develop a <b>digital common</b>, that everyone can make their own, which respects <b>privacy and activism by design</b>.": "We want to develop a <b>digital common</b>, that everyone can make their own, which respects <b>privacy and activism by design</b>.",
"We wont change the world from Facebook. The tool we dream of, surveillance capitalism corporations wont develop it, as they couldnt profit from it. This is an opportunity to build something better, by taking another approach.": "We wont change the world from Facebook. The tool we dream of, surveillance capitalism corporations wont develop it, as they couldnt profit from it. This is an opportunity to build something better, by taking another approach.", "We wont change the world from Facebook. The tool we dream of, surveillance capitalism corporations wont develop it, as they couldnt profit from it. This is an opportunity to build something better, by taking another approach.": "We wont change the world from Facebook. The tool we dream of, surveillance capitalism corporations wont develop it, as they couldnt profit from it. This is an opportunity to build something better, by taking another approach.",
"Website / URL": "Website / URL", "Website / URL": "Website / URL",
"Welcome back {username}": "Welcome back {username}", "Welcome back {username}!": "Welcome back {username}!",
"Welcome back!": "Welcome back!", "Welcome back!": "Welcome back!",
"Welcome on your administration panel": "Welcome on your administration panel", "Welcome on your administration panel": "Welcome on your administration panel",
"Welcome to Mobilizon, {username}!": "Welcome to Mobilizon, {username}!",
"Who can view this event and participate": "Who can view this event and participate", "Who can view this event and participate": "Who can view this event and participate",
"World map": "World map", "World map": "World map",
"You and one other person are going to this event": "You're the only one going to this event | You and one other person are going to this event | You and {approved} persons are going to this event.", "You and one other person are going to this event": "You're the only one going to this event | You and one other person are going to this event | You and {approved} persons are going to this event.",

View File

@ -159,7 +159,6 @@
"No events found": "Aucun événement trouvé", "No events found": "Aucun événement trouvé",
"No group found": "Aucun groupe trouvé", "No group found": "Aucun groupe trouvé",
"No groups found": "Aucun groupe trouvé", "No groups found": "Aucun groupe trouvé",
"No participants yet": "Aucun⋅e participant⋅e pour le moment",
"No results for \"{queryText}\"": "Pas de résultats pour « {queryText} »", "No results for \"{queryText}\"": "Pas de résultats pour « {queryText} »",
"Number of places": "Nombre de places", "Number of places": "Nombre de places",
"OK": "OK", "OK": "OK",
@ -283,9 +282,10 @@
"We want to develop a <b>digital common</b>, that everyone can make their own, which respects <b>privacy and activism by design</b>.": "Nous voulons développer un <b>commun numérique</b>, que tout le monde pourra sapproprier, conçu dans <b>le respect de la vie privée et de laction militante</b>.", "We want to develop a <b>digital common</b>, that everyone can make their own, which respects <b>privacy and activism by design</b>.": "Nous voulons développer un <b>commun numérique</b>, que tout le monde pourra sapproprier, conçu dans <b>le respect de la vie privée et de laction militante</b>.",
"We wont change the world from Facebook. The tool we dream of, surveillance capitalism corporations wont develop it, as they couldnt profit from it. This is an opportunity to build something better, by taking another approach.": "On ne changera pas le monde depuis Facebook. Loutil dont nous rêvons, les entreprises du capitalisme de surveillance sont incapables de le produire, car elles ne sauraient pas en tirer profit. Cest loccasion de faire mieux quelles, en faisant autrement.", "We wont change the world from Facebook. The tool we dream of, surveillance capitalism corporations wont develop it, as they couldnt profit from it. This is an opportunity to build something better, by taking another approach.": "On ne changera pas le monde depuis Facebook. Loutil dont nous rêvons, les entreprises du capitalisme de surveillance sont incapables de le produire, car elles ne sauraient pas en tirer profit. Cest loccasion de faire mieux quelles, en faisant autrement.",
"Website / URL": "Site web / URL", "Website / URL": "Site web / URL",
"Welcome back {username}": "Bon retour {username}", "Welcome back {username}!": "Bon retour {username} !",
"Welcome back!": "Bon retour !", "Welcome back!": "Bon retour !",
"Welcome on your administration panel": "Bienvenue sur votre espace d'administration", "Welcome on your administration panel": "Bienvenue sur votre espace d'administration",
"Welcome to Mobilizon, {username}!": "Bienvenue sur Mobilizon, {username} !",
"Who can view this event and participate": "Qui peut voir cet événement et y participer", "Who can view this event and participate": "Qui peut voir cet événement et y participer",
"World map": "Carte mondiale", "World map": "Carte mondiale",
"You and one other person are going to this event": "Vous êtes le ou la seule à vous rendre à cet événement | Vous et une autre personne vous rendez à cet événement | Vous et {approved} autres personnes vous rendez à cet événement.", "You and one other person are going to this event": "Vous êtes le ou la seule à vous rendre à cet événement | Vous et une autre personne vous rendez à cet événement | Vous et {approved} autres personnes vous rendez à cet événement.",

View File

@ -156,7 +156,6 @@
"Only accessible through link and search (private)": "Solament accessible via ligam e la recèrca (privat)", "Only accessible through link and search (private)": "Solament accessible via ligam e la recèrca (privat)",
"One person is going": "Degun i va pas | Una persona i va | {approved} personas i van", "One person is going": "Degun i va pas | Una persona i va | {approved} personas i van",
"No results for \"{queryText}\"": "Cap de resultats per « {queryText} »", "No results for \"{queryText}\"": "Cap de resultats per « {queryText} »",
"No participants yet.": "Cap de participacion pel moment.",
"No groups found": "Cap de grop pas trobat", "No groups found": "Cap de grop pas trobat",
"No group found": "Cap de grop pas trobat", "No group found": "Cap de grop pas trobat",
"No events found": "Cap deveniment pas trobat", "No events found": "Cap deveniment pas trobat",
@ -210,7 +209,7 @@
"Are you sure you want to cancel your participation at event \"{title}\"?": "Volètz vertadièrament anullar vòstra participacion a leveniment « {title} » ?", "Are you sure you want to cancel your participation at event \"{title}\"?": "Volètz vertadièrament anullar vòstra participacion a leveniment « {title} » ?",
"A validation email was sent to {email}": "Un corrièl de validat es estat enviar a {email}", "A validation email was sent to {email}": "Un corrièl de validat es estat enviar a {email}",
"Welcome back!": "Tornatz ben aquí !", "Welcome back!": "Tornatz ben aquí !",
"Welcome back {username}": "Tornatz ben {username}", "Welcome back {username}!": "Tornatz ben {username} !",
"You have one event in {days} days.": "Avètz pas cap deveniment daquí {days} jorns | Avètz un eveniment daquí {days} jorns. | Avètz {count} eveniments daquí {days} jorns", "You have one event in {days} days.": "Avètz pas cap deveniment daquí {days} jorns | Avètz un eveniment daquí {days} jorns. | Avètz {count} eveniments daquí {days} jorns",
"You and one other person are going to this event": "Sètz lunica persona a anar a aqueste eveniment | Vos e una persona mai anatz a aqueste eveniment | Vos e {approved} personas mai anatz a aqueste eveniment.", "You and one other person are going to this event": "Sètz lunica persona a anar a aqueste eveniment | Vos e una persona mai anatz a aqueste eveniment | Vos e {approved} personas mai anatz a aqueste eveniment.",
"This will delete / anonymize all content (events, comments, messages, participations…) created from this identity.": "Aquò suprimirà / far venir anonim tot lo contengut (eveniments, comentaris, messatges, participacions…) creat amb aquesta identitat.", "This will delete / anonymize all content (events, comments, messages, participations…) created from this identity.": "Aquò suprimirà / far venir anonim tot lo contengut (eveniments, comentaris, messatges, participacions…) creat amb aquesta identitat.",

View File

@ -108,6 +108,7 @@ export default class Register extends Vue {
}); });
if (data) { if (data) {
this.validationSent = true; this.validationSent = true;
window.localStorage.setItem('new-registered-user', 'yes');
if (this.userAlreadyActivated) { if (this.userAlreadyActivated) {
await changeIdentity(this.$apollo.provider.defaultClient, data.registerPerson); await changeIdentity(this.$apollo.provider.defaultClient, data.registerPerson);

View File

@ -25,9 +25,12 @@
</div> </div>
</section> </section>
<div class="container" v-if="config"> <div class="container" v-if="config">
<section v-if="currentActor.id && welcomeBack"> <section v-if="currentActor.id">
<b-message type="is-info"> <b-message type="is-info" v-if="welcomeBack">
{{ $t('Welcome back {username}', { username: currentActor.displayName() }) }} {{ $t('Welcome back {username}!', { username: currentActor.displayName() }) }}
</b-message>
<b-message type="is-info" v-if="newRegisteredUser">
{{ $t('Welcome to Mobilizon, {username}!', { username: currentActor.displayName() }) }}
</b-message> </b-message>
</section> </section>
<section v-if="currentActor.id && goingToEvents.size > 0" class="container"> <section v-if="currentActor.id && goingToEvents.size > 0" class="container">
@ -187,9 +190,18 @@ export default class Home extends Vue {
return window.localStorage.getItem('welcome-back') === 'yes'; return window.localStorage.getItem('welcome-back') === 'yes';
} }
get newRegisteredUser() {
return window.localStorage.getItem('new-registered-user') === 'yes';
}
mounted() { mounted() {
if (window.localStorage.getItem('welcome-back')) {
window.localStorage.removeItem('welcome-back'); window.localStorage.removeItem('welcome-back');
} }
if (window.localStorage.getItem('new-registered-user')) {
window.localStorage.removeItem('new-registered-user');
}
}
isToday(date: Date) { isToday(date: Date) {
return (new Date(date)).toDateString() === (new Date()).toDateString(); return (new Date(date)).toDateString() === (new Date()).toDateString();

View File

@ -78,6 +78,6 @@ describe('Login', () => {
cy.wait(1000); cy.wait(1000);
cy.get('.navbar-link span.icon i').should('have.class', 'mdi-account-circle'); cy.get('.navbar-link span.icon i').should('have.class', 'mdi-account-circle');
cy.contains('article.message.is-info', 'Welcome back DuplicateNot'); cy.contains('article.message.is-info', 'Welcome to Mobilizon, DuplicateNot!');
}); });
}); });

View File

@ -66,6 +66,6 @@ describe('Registration', () => {
}); });
cy.get('.navbar-link span.icon i').should('have.class', 'mdi-account-circle'); cy.get('.navbar-link span.icon i').should('have.class', 'mdi-account-circle');
cy.contains('article.message.is-info', 'Welcome back tester account'); cy.contains('article.message.is-info', 'Welcome to Mobilizon, tester account!');
}); });
}); });