poc(batch_operation_alert): simplier wording
This commit is contained in:
parent
3d2f0ebb88
commit
7c65af3be0
8 changed files with 28 additions and 68 deletions
|
@ -13,12 +13,6 @@ RSpec.describe Dossiers::BatchAlertComponent, type: :component do
|
|||
|
||||
subject { render_inline(component).to_html }
|
||||
|
||||
context 'beginning' do
|
||||
it { is_expected.to have_selector('.fr-alert--info') }
|
||||
it { is_expected.to have_text("Une action de masse est en cours") }
|
||||
it { is_expected.to have_text("0/ 2 dossier archivé") }
|
||||
end
|
||||
|
||||
context 'in_progress' do
|
||||
before {
|
||||
batch_operation.track_processed_dossier(true, dossier)
|
||||
|
@ -27,7 +21,7 @@ RSpec.describe Dossiers::BatchAlertComponent, type: :component do
|
|||
|
||||
it { is_expected.to have_selector('.fr-alert--info') }
|
||||
it { is_expected.to have_text("Une action de masse est en cours") }
|
||||
it { is_expected.to have_text("1 dossier a été archivé") }
|
||||
it { is_expected.to have_text("1/2 dossiers ont été archivés") }
|
||||
end
|
||||
|
||||
context 'finished and success' do
|
||||
|
@ -41,12 +35,6 @@ RSpec.describe Dossiers::BatchAlertComponent, type: :component do
|
|||
it { is_expected.to have_text("L'action de masse est terminée") }
|
||||
it { is_expected.to have_text("2 dossiers ont été archivés") }
|
||||
it { expect(batch_operation.seen_at).to eq(nil) }
|
||||
|
||||
it 'does not display alert on the next render' do
|
||||
render_inline(component).to_html
|
||||
expect(batch_operation.seen_at).not_to eq(nil)
|
||||
expect(subject).not_to have_text("2 dossiers ont été archivés")
|
||||
end
|
||||
end
|
||||
|
||||
context 'finished and fail' do
|
||||
|
@ -58,7 +46,7 @@ RSpec.describe Dossiers::BatchAlertComponent, type: :component do
|
|||
|
||||
it { is_expected.to have_selector('.fr-alert--warning') }
|
||||
it { is_expected.to have_text("L'action de masse est terminée") }
|
||||
it { is_expected.to have_text("1 dossier n'a pas été archivé") }
|
||||
it { is_expected.to have_text("1/2 dossiers ont été archivés") }
|
||||
it { expect(batch_operation.seen_at).to eq(nil) }
|
||||
|
||||
it 'does not display alert on the next render' do
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue