Skip to content

Commit

Permalink
fix: tests
Browse files Browse the repository at this point in the history
  • Loading branch information
thiagoyoussef committed Nov 13, 2024
1 parent cdcc2f1 commit 8505164
Show file tree
Hide file tree
Showing 20 changed files with 29 additions and 26 deletions.
2 changes: 1 addition & 1 deletion lib/generators/avo/templates/locales/avo.ar.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ ar:
loading: جاري التحميل
more: المزيد
more_content: المزيد من المحتوى
more_records_available: هناك المزيد من السجلات المتاحة.
new: جديد
next_page: الصفحة التالية
no_cancel: لا، إلغاء
Expand Down Expand Up @@ -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: هناك المزيد من السجلات المتاحة.
2 changes: 1 addition & 1 deletion lib/generators/avo/templates/locales/avo.de.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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.
2 changes: 1 addition & 1 deletion lib/generators/avo/templates/locales/avo.en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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.
2 changes: 1 addition & 1 deletion lib/generators/avo/templates/locales/avo.es.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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.
2 changes: 1 addition & 1 deletion lib/generators/avo/templates/locales/avo.fr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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.
2 changes: 1 addition & 1 deletion lib/generators/avo/templates/locales/avo.it.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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.
2 changes: 1 addition & 1 deletion lib/generators/avo/templates/locales/avo.ja.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ ja:
loading: 読み込み中
more: もっと
more_content: さらなるコンテンツ
more_records_available: さらに多くのレコードが利用可能です。
new: 新規
next_page: 次のページ
no_cancel: いいえ、キャンセル
Expand Down Expand Up @@ -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: さらに多くのレコードが利用可能です。
2 changes: 1 addition & 1 deletion lib/generators/avo/templates/locales/avo.nb.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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.
2 changes: 1 addition & 1 deletion lib/generators/avo/templates/locales/avo.nl.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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.
2 changes: 1 addition & 1 deletion lib/generators/avo/templates/locales/avo.nn.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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.
2 changes: 1 addition & 1 deletion lib/generators/avo/templates/locales/avo.pl.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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.
2 changes: 1 addition & 1 deletion lib/generators/avo/templates/locales/avo.pt-BR.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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.
2 changes: 1 addition & 1 deletion lib/generators/avo/templates/locales/avo.pt.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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.
2 changes: 1 addition & 1 deletion lib/generators/avo/templates/locales/avo.ro.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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ă
Expand Down Expand Up @@ -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.
2 changes: 1 addition & 1 deletion lib/generators/avo/templates/locales/avo.ru.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ ru:
loading: Загрузка...
more: Ещё
more_content: Больше контента
more_records_available: Доступно больше записей.
new: новый
next_page: Следующая страница
no_cancel: Нет, отмена
Expand Down Expand Up @@ -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: Доступно больше записей.
2 changes: 1 addition & 1 deletion lib/generators/avo/templates/locales/avo.tr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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.
2 changes: 1 addition & 1 deletion lib/generators/avo/templates/locales/avo.uk.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ uk:
loading: Завантаження
more: Ще
more_content: Більше вмісту
more_records_available: Є більше доступних записів.
new: новий
next_page: Наступна сторінка
no_cancel: Ні, скасувати
Expand Down Expand Up @@ -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: Є більше доступних записів.
2 changes: 1 addition & 1 deletion lib/generators/avo/templates/locales/avo.zh.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ zh:
loading: 加载中...
more: 更多
more_content: 更多内容
more_records_available: 还有更多记录可供参考。
new: 新建
next_page: 下一页
no_cancel: 不,取消
Expand Down Expand Up @@ -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: 还有更多记录可供参考。
5 changes: 3 additions & 2 deletions spec/system/avo/associations_using_fields_api_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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"]')
Expand Down
14 changes: 8 additions & 6 deletions spec/system/avo/create_via_belongs_to_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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."]'
Expand All @@ -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'

Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 8505164

Please sign in to comment.