From 850516404d7e1dfc384d31b41aae30febaa6a7c6 Mon Sep 17 00:00:00 2001 From: Thiago Youssef <43591948+thiagoyoussef@users.noreply.github.com> Date: Wed, 13 Nov 2024 20:47:01 -0300 Subject: [PATCH] fix: tests --- lib/generators/avo/templates/locales/avo.ar.yml | 2 +- lib/generators/avo/templates/locales/avo.de.yml | 2 +- lib/generators/avo/templates/locales/avo.en.yml | 2 +- lib/generators/avo/templates/locales/avo.es.yml | 2 +- lib/generators/avo/templates/locales/avo.fr.yml | 2 +- lib/generators/avo/templates/locales/avo.it.yml | 2 +- lib/generators/avo/templates/locales/avo.ja.yml | 2 +- lib/generators/avo/templates/locales/avo.nb.yml | 2 +- lib/generators/avo/templates/locales/avo.nl.yml | 2 +- lib/generators/avo/templates/locales/avo.nn.yml | 2 +- lib/generators/avo/templates/locales/avo.pl.yml | 2 +- lib/generators/avo/templates/locales/avo.pt-BR.yml | 2 +- lib/generators/avo/templates/locales/avo.pt.yml | 2 +- lib/generators/avo/templates/locales/avo.ro.yml | 2 +- lib/generators/avo/templates/locales/avo.ru.yml | 2 +- lib/generators/avo/templates/locales/avo.tr.yml | 2 +- lib/generators/avo/templates/locales/avo.uk.yml | 2 +- lib/generators/avo/templates/locales/avo.zh.yml | 2 +- .../avo/associations_using_fields_api_spec.rb | 5 +++-- spec/system/avo/create_via_belongs_to_spec.rb | 14 ++++++++------ 20 files changed, 29 insertions(+), 26 deletions(-) diff --git a/lib/generators/avo/templates/locales/avo.ar.yml b/lib/generators/avo/templates/locales/avo.ar.yml index 40dc0d666..d9c7a622b 100644 --- a/lib/generators/avo/templates/locales/avo.ar.yml +++ b/lib/generators/avo/templates/locales/avo.ar.yml @@ -72,6 +72,7 @@ ar: loading: جاري التحميل more: المزيد more_content: المزيد من المحتوى + more_records_available: هناك المزيد من السجلات المتاحة. new: جديد next_page: الصفحة التالية no_cancel: لا، إلغاء @@ -133,4 +134,3 @@ ar: you_cant_upload_new_resource: لا يمكنك تحميل الملفات في محرر Trix حتى تحفظ السجل. you_havent_set_attachment_key: لم تقم بتعيين `attachment_key` لهذا الحقل Trix. you_missed_something_check_form: ربما نسيت شيئًا، يرجى التحقق من البيانات. - more_records_available: هناك المزيد من السجلات المتاحة. diff --git a/lib/generators/avo/templates/locales/avo.de.yml b/lib/generators/avo/templates/locales/avo.de.yml index bb701d915..3adafaf5d 100644 --- a/lib/generators/avo/templates/locales/avo.de.yml +++ b/lib/generators/avo/templates/locales/avo.de.yml @@ -62,6 +62,7 @@ de: loading: Lade... more: Mehr more_content: Mehr Inhalt + more_records_available: Es sind weitere Datensätze verfügbar. new: neu next_page: Nächste Seite no_cancel: Nein, abbrechen @@ -123,4 +124,3 @@ de: you_cant_upload_new_resource: Du kannst keine Dateien in den Trix-Editor hochladen, bis die Ressource gespeichert ist. you_havent_set_attachment_key: Du hast keinen `attachment_key` für dieses Trix-Feld festgelegt. you_missed_something_check_form: Sie haben möglicherweise etwas übersehen. Bitte überprüfen Sie das Formular. - more_records_available: Es sind weitere Datensätze verfügbar. diff --git a/lib/generators/avo/templates/locales/avo.en.yml b/lib/generators/avo/templates/locales/avo.en.yml index 4f074ddec..31330c706 100644 --- a/lib/generators/avo/templates/locales/avo.en.yml +++ b/lib/generators/avo/templates/locales/avo.en.yml @@ -62,6 +62,7 @@ en: loading: Loading more: More more_content: More content + more_records_available: There are more records available. new: new next_page: Next page no_cancel: No, cancel @@ -123,4 +124,3 @@ en: you_cant_upload_new_resource: You can't upload files into the Trix editor until you save the resource. you_havent_set_attachment_key: You haven't set an `attachment_key` to this Trix field. you_missed_something_check_form: You might have missed something. Please check the form. - more_records_available: There are more records available. diff --git a/lib/generators/avo/templates/locales/avo.es.yml b/lib/generators/avo/templates/locales/avo.es.yml index 566b729f6..ea50e8f0c 100644 --- a/lib/generators/avo/templates/locales/avo.es.yml +++ b/lib/generators/avo/templates/locales/avo.es.yml @@ -64,6 +64,7 @@ es: loading: Cargando more: Más more_content: Más contenido + more_records_available: Hay más registros disponibles. new: nuevo/a next_page: Página siguiente no_cancel: No, cancelar @@ -125,4 +126,3 @@ es: you_cant_upload_new_resource: No puedes subir archivos al editor Trix hasta que guardes el recurso. you_havent_set_attachment_key: No has establecido una `attachment_key` para este campo Trix. you_missed_something_check_form: Es posible que hayas pasado algo por alto. Comprueba el formulario. - more_records_available: Hay más registros disponibles. diff --git a/lib/generators/avo/templates/locales/avo.fr.yml b/lib/generators/avo/templates/locales/avo.fr.yml index f026c8e56..1d88cf028 100644 --- a/lib/generators/avo/templates/locales/avo.fr.yml +++ b/lib/generators/avo/templates/locales/avo.fr.yml @@ -64,6 +64,7 @@ fr: loading: Chargement more: Plus more_content: Plus de contenu + more_records_available: Il y a plus d'enregistrements disponibles. new: Nouveau next_page: Page suivante no_cancel: Non, annuler @@ -125,4 +126,3 @@ fr: you_cant_upload_new_resource: Vous ne pouvez pas télécharger de fichiers dans l'éditeur Trix tant que vous n'avez pas enregistré la ressource. you_havent_set_attachment_key: Vous devez définir une `attachment_key` pour ce champ Trix. you_missed_something_check_form: Vous avez peut-être oublié quelque chose. Veuillez vérifier le formulaire - more_records_available: Il y a plus d'enregistrements disponibles. diff --git a/lib/generators/avo/templates/locales/avo.it.yml b/lib/generators/avo/templates/locales/avo.it.yml index 251095f61..fbf7c1b59 100644 --- a/lib/generators/avo/templates/locales/avo.it.yml +++ b/lib/generators/avo/templates/locales/avo.it.yml @@ -62,6 +62,7 @@ it: loading: Caricamento in corso more: Altro more_content: Più contenuti + more_records_available: Sono disponibili più record. new: nuovo next_page: Pagina successiva no_cancel: No, annulla @@ -123,4 +124,3 @@ it: you_cant_upload_new_resource: Non puoi caricare file nell'editor Trix finché non salvi la risorsa. you_havent_set_attachment_key: Non hai impostato un `attachment_key` per questo campo Trix. you_missed_something_check_form: Potresti aver dimenticato qualcosa. Controlla il modulo. - more_records_available: Sono disponibili più record. diff --git a/lib/generators/avo/templates/locales/avo.ja.yml b/lib/generators/avo/templates/locales/avo.ja.yml index cc178ac7d..ca84e6a35 100644 --- a/lib/generators/avo/templates/locales/avo.ja.yml +++ b/lib/generators/avo/templates/locales/avo.ja.yml @@ -64,6 +64,7 @@ ja: loading: 読み込み中 more: もっと more_content: さらなるコンテンツ + more_records_available: さらに多くのレコードが利用可能です。 new: 新規 next_page: 次のページ no_cancel: いいえ、キャンセル @@ -125,4 +126,3 @@ ja: you_cant_upload_new_resource: リソースを保存するまで、Trixエディタにファイルをアップロードすることはできません。 you_havent_set_attachment_key: このTrixフィールドに`attachment_key`が設定されていません。 you_missed_something_check_form: 何か見落としているかもしれません。フォームを確認してください。 - more_records_available: さらに多くのレコードが利用可能です。 diff --git a/lib/generators/avo/templates/locales/avo.nb.yml b/lib/generators/avo/templates/locales/avo.nb.yml index 46a9f8aa8..5282cc6bc 100644 --- a/lib/generators/avo/templates/locales/avo.nb.yml +++ b/lib/generators/avo/templates/locales/avo.nb.yml @@ -64,6 +64,7 @@ nb: loading: Laster more: Mer more_content: Mer innhold + more_records_available: Det er flere poster tilgjengelig. new: ny next_page: Neste side no_cancel: Nei, avbryt @@ -125,4 +126,3 @@ nb: you_cant_upload_new_resource: Du kan ikke laste opp filer til Trix editoren før du lagrer ressursen. you_havent_set_attachment_key: Du har ikke satt en `attachment_key` til dette Trix-feltet. you_missed_something_check_form: Her mangler du noe. Vennligst sjekk skjemaet. - more_records_available: Det er flere poster tilgjengelig. diff --git a/lib/generators/avo/templates/locales/avo.nl.yml b/lib/generators/avo/templates/locales/avo.nl.yml index 3432bdcce..31cfd5101 100644 --- a/lib/generators/avo/templates/locales/avo.nl.yml +++ b/lib/generators/avo/templates/locales/avo.nl.yml @@ -62,6 +62,7 @@ nl: loading: Laden... more: Meer more_content: Meer inhoud + more_records_available: Er zijn meer records beschikbaar. new: nieuw next_page: Volgende pagina no_cancel: Nee, annuleren @@ -123,4 +124,3 @@ nl: you_cant_upload_new_resource: Je kunt geen bestanden uploaden in de Trix-editor totdat je de bron hebt opgeslagen. you_havent_set_attachment_key: Je hebt geen `attachment_key` ingesteld voor dit Trix-veld. you_missed_something_check_form: U heeft mogelijk iets gemist. Controleer het formulier. - more_records_available: Er zijn meer records beschikbaar. diff --git a/lib/generators/avo/templates/locales/avo.nn.yml b/lib/generators/avo/templates/locales/avo.nn.yml index 2a4b1066f..247a5b91a 100644 --- a/lib/generators/avo/templates/locales/avo.nn.yml +++ b/lib/generators/avo/templates/locales/avo.nn.yml @@ -64,6 +64,7 @@ nn: loading: Lastar more: Meir more_content: Mer innhold + more_records_available: Det finst fleire opptak tilgjengelege. new: ny next_page: Neste side no_cancel: Nei, avbryt @@ -125,4 +126,3 @@ nn: you_cant_upload_new_resource: Du kan ikkje laste opp filer til Trix-editoren før du lagrar ressursen. you_havent_set_attachment_key: Du har ikkje sett ein `attachment_key` til dette Trix-feltet. you_missed_something_check_form: Her manglar du noko. Ver venleg og sjekk skjemaet. - more_records_available: Det finst fleire opptak tilgjengelege. diff --git a/lib/generators/avo/templates/locales/avo.pl.yml b/lib/generators/avo/templates/locales/avo.pl.yml index 4cd5fd2d4..b698d73f6 100644 --- a/lib/generators/avo/templates/locales/avo.pl.yml +++ b/lib/generators/avo/templates/locales/avo.pl.yml @@ -64,6 +64,7 @@ pl: loading: Ładowanie more: Więcej more_content: Pokaż wiecej + more_records_available: Dostępnych jest więcej rekordów. new: nowy next_page: Następna strona no_cancel: Nie, anuluj @@ -125,4 +126,3 @@ pl: you_cant_upload_new_resource: Nie możesz przesyłać plików do edytora Trix, dopóki nie zapiszesz zasobu. you_havent_set_attachment_key: Nie ustawiłeś `attachment_key` dla tego pola Trix. you_missed_something_check_form: Możliwe, że coś przeoczyłeś. Sprawdź formularz. - more_records_available: Dostępnych jest więcej rekordów. diff --git a/lib/generators/avo/templates/locales/avo.pt-BR.yml b/lib/generators/avo/templates/locales/avo.pt-BR.yml index d1afe1504..fcc6a1c65 100644 --- a/lib/generators/avo/templates/locales/avo.pt-BR.yml +++ b/lib/generators/avo/templates/locales/avo.pt-BR.yml @@ -64,6 +64,7 @@ pt-BR: loading: Carregando more: Mais more_content: Mais conteúdo + more_records_available: Existem mais registros disponíveis. new: novo next_page: Próxima página no_cancel: Não, cancelar @@ -125,4 +126,3 @@ pt-BR: you_cant_upload_new_resource: Você não pode fazer upload de imagens no editor Trix até salvar o recurso. you_havent_set_attachment_key: Você precisa definir uma `attachment_key` para este campo Trix. you_missed_something_check_form: Você pode ter esquecido algo. Por favor, cheque o formulário. - more_records_available: Existem mais registros disponíveis. diff --git a/lib/generators/avo/templates/locales/avo.pt.yml b/lib/generators/avo/templates/locales/avo.pt.yml index e2b825523..f61de9cd3 100644 --- a/lib/generators/avo/templates/locales/avo.pt.yml +++ b/lib/generators/avo/templates/locales/avo.pt.yml @@ -64,6 +64,7 @@ pt: loading: A carregar more: Mais more_content: Mais conteúdo + more_records_available: Existem mais registos disponíveis. new: novo next_page: Próxima página no_cancel: Não, cancelar @@ -125,4 +126,3 @@ pt: you_cant_upload_new_resource: Não pode carregar ficheiros no editor Trix até guardar o recurso. you_havent_set_attachment_key: Precisa definir uma `attachment_key` para este campo Trix. you_missed_something_check_form: Pode ter-se esquecido algo. Por favor, verifique o formulário. - more_records_available: Existem mais registos disponíveis. diff --git a/lib/generators/avo/templates/locales/avo.ro.yml b/lib/generators/avo/templates/locales/avo.ro.yml index 8bde5822c..d1aa5e733 100644 --- a/lib/generators/avo/templates/locales/avo.ro.yml +++ b/lib/generators/avo/templates/locales/avo.ro.yml @@ -66,6 +66,7 @@ ro: loading: Se incarcă more: Mai multe more_content: Mai mult conținut + more_records_available: Sunt mai multe înregistrări disponibile. new: nou next_page: Pagina următoare no_cancel: Nu, anulează @@ -127,4 +128,3 @@ ro: you_cant_upload_new_resource: Nu poți încărca fișiere în editorul Trix până când nu salvezi resursa. you_havent_set_attachment_key: Trebuie să setezi o `attachment_key` pentru acest câmp Trix. you_missed_something_check_form: S-ar putea să fi omis ceva. Vă rugăm să verificați formularul. - more_records_available: Sunt mai multe înregistrări disponibile. diff --git a/lib/generators/avo/templates/locales/avo.ru.yml b/lib/generators/avo/templates/locales/avo.ru.yml index d5cad7a45..1c0703a25 100644 --- a/lib/generators/avo/templates/locales/avo.ru.yml +++ b/lib/generators/avo/templates/locales/avo.ru.yml @@ -64,6 +64,7 @@ ru: loading: Загрузка... more: Ещё more_content: Больше контента + more_records_available: Доступно больше записей. new: новый next_page: Следующая страница no_cancel: Нет, отмена @@ -125,4 +126,3 @@ ru: you_cant_upload_new_resource: Вы не можете загружать файлы в редактор Trix, пока не сохраните ресурс. you_havent_set_attachment_key: Вы не установили `attachment_key` для этого поля Trix. you_missed_something_check_form: Возможно, вы что-то упустили. Пожалуйста, проверьте форму. - more_records_available: Доступно больше записей. diff --git a/lib/generators/avo/templates/locales/avo.tr.yml b/lib/generators/avo/templates/locales/avo.tr.yml index 2ab4f7aaf..1db265e5c 100644 --- a/lib/generators/avo/templates/locales/avo.tr.yml +++ b/lib/generators/avo/templates/locales/avo.tr.yml @@ -64,6 +64,7 @@ tr: loading: Yükleniyor more: Daha fazla more_content: Daha fazla içerik + more_records_available: Daha fazla kayıt mevcut. new: yeni next_page: Sonraki sayfa no_cancel: Hayır, iptal et @@ -125,4 +126,3 @@ tr: you_cant_upload_new_resource: Kaynağı kaydedene kadar Trix editörüne dosya yükleyemezsiniz. you_havent_set_attachment_key: Bu Trix alanına bir `attachment_key` ayarlamadınız. you_missed_something_check_form: Bir şeyleri kaçırmış olabilirsiniz. Lütfen formu kontrol edin. - more_records_available: Daha fazla kayıt mevcut. diff --git a/lib/generators/avo/templates/locales/avo.uk.yml b/lib/generators/avo/templates/locales/avo.uk.yml index f58730062..fadc18a74 100644 --- a/lib/generators/avo/templates/locales/avo.uk.yml +++ b/lib/generators/avo/templates/locales/avo.uk.yml @@ -64,6 +64,7 @@ uk: loading: Завантаження more: Ще more_content: Більше вмісту + more_records_available: Є більше доступних записів. new: новий next_page: Наступна сторінка no_cancel: Ні, скасувати @@ -125,4 +126,3 @@ uk: you_cant_upload_new_resource: Ви не можете завантажувати файли в редактор Trix, поки не збережете ресурс. you_havent_set_attachment_key: Ви не встановили `attachment_key` для цього поля Trix. you_missed_something_check_form: Можливо, ви щось пропустили. Перевірте форму. - more_records_available: Є більше доступних записів. diff --git a/lib/generators/avo/templates/locales/avo.zh.yml b/lib/generators/avo/templates/locales/avo.zh.yml index a4223e07c..aeabdae42 100644 --- a/lib/generators/avo/templates/locales/avo.zh.yml +++ b/lib/generators/avo/templates/locales/avo.zh.yml @@ -62,6 +62,7 @@ zh: loading: 加载中... more: 更多 more_content: 更多内容 + more_records_available: 还有更多记录可供参考。 new: 新建 next_page: 下一页 no_cancel: 不,取消 @@ -123,4 +124,3 @@ zh: you_cant_upload_new_resource: 在保存资源之前,您无法将文件上传到 Trix 编辑器。 you_havent_set_attachment_key: 您尚未为此 Trix 字段设置 `attachment_key`。 you_missed_something_check_form: 您可能漏掉了一些内容,请检查表单。 - more_records_available: 还有更多记录可供参考。 diff --git a/spec/system/avo/associations_using_fields_api_spec.rb b/spec/system/avo/associations_using_fields_api_spec.rb index b15c6b57e..e36d927cc 100644 --- a/spec/system/avo/associations_using_fields_api_spec.rb +++ b/spec/system/avo/associations_using_fields_api_spec.rb @@ -35,9 +35,10 @@ context "when associations options exceeds associations_query_limit" do let!(:link) { Course::Link.first } - it "limits select options" do - Avo.configuration.associations_query_limit = 1 + before { Avo.configuration.associations_query_limit = 1 } + after { Avo.configuration.associations_query_limit = 2000 } + it "limits select options" do visit avo.resources_course_path(course) scroll_to find('turbo-frame[id="has_many_field_show_links"]') diff --git a/spec/system/avo/create_via_belongs_to_spec.rb b/spec/system/avo/create_via_belongs_to_spec.rb index 97d0b2b47..dcfddd3d1 100644 --- a/spec/system/avo/create_via_belongs_to_spec.rb +++ b/spec/system/avo/create_via_belongs_to_spec.rb @@ -97,9 +97,10 @@ let!(:course) { create :course } let!(:exceeded_course) { create :course } - it "limits select options" do - Avo.configuration.associations_query_limit = 1 + before { Avo.configuration.associations_query_limit = 1 } + after { Avo.configuration.associations_query_limit = 2000 } + it "limits select options" do visit "/admin/resources/course_links/new" expect(page).to have_select "course_link_course_id", options: ["Choose an option", course.name, "There are more records available."] expect(page).to have_selector 'option[disabled="disabled"][value="There are more records available."]' @@ -109,7 +110,7 @@ context 'with polymorphic belongs_to' do it 'successfully creates a new commentable and assigns it to the comment', :aggregate_failures do - visit '/admin/resources/comments/new' + visit "/admin/resources/comments/new" fill_in 'comment_body', with: 'Test comment' @@ -142,10 +143,11 @@ let!(:user) { User.first } let!(:exceeded_user) { create :user } - it "limits select options" do - Avo.configuration.associations_query_limit = 1 + before { Avo.configuration.associations_query_limit = 1 } + after { Avo.configuration.associations_query_limit = 2000 } - visit '/admin/resources/comments/new' + it "limits select options" do + visit "/admin/resources/comments/new" expect(page).to have_select "comment_user_id", options: ["Choose an option", user.name, "There are more records available."] expect(page).to have_selector 'option[disabled="disabled"][value="There are more records available."]' end