fix broken tabs with turbostream

This commit is contained in:
Lisa Durand 2023-02-27 14:30:10 +01:00
parent 6487e2c27e
commit 636e6aa6cb
3 changed files with 12 additions and 11 deletions

View file

@ -6,7 +6,7 @@
pour voir si l'opération est finie. pour voir si l'opération est finie.
.sub-header .sub-header
.container .container.turbo-header
.flex.fr-mb-3w .flex.fr-mb-3w
%div %div
%h1.fr-h2.fr-mb-1w %h1.fr-h2.fr-mb-1w
@ -26,6 +26,7 @@
%p.fr-mb-1w %p.fr-mb-1w
%small Lusager a supprimé son compte. Vous pouvez archiver puis supprimer le dossier. %small Lusager a supprimé son compte. Vous pouvez archiver puis supprimer le dossier.
.container
%nav.tabs %nav.tabs
%ul %ul
- notifications_summary = current_instructeur.notifications_for_dossier(dossier) - notifications_summary = current_instructeur.notifications_for_dossier(dossier)

View file

@ -1 +1 @@
= turbo_stream.update_all '.sub-header', partial: 'header', locals: { dossier: @dossier } = turbo_stream.update_all '.turbo-header', partial: 'header', locals: { dossier: @dossier }

View file

@ -154,7 +154,7 @@ describe Instructeurs::DossiersController, type: :controller do
it { expect(dossier.reload.state).to eq(Dossier.states.fetch(:en_instruction)) } it { expect(dossier.reload.state).to eq(Dossier.states.fetch(:en_instruction)) }
it { expect(instructeur.follow?(dossier)).to be true } it { expect(instructeur.follow?(dossier)).to be true }
it { expect(response).to have_http_status(:ok) } it { expect(response).to have_http_status(:ok) }
it { expect(response.body).to include('.sub-header') } it { expect(response.body).to include('.turbo-header') }
context 'when the dossier has already been put en_instruction' do context 'when the dossier has already been put en_instruction' do
let(:dossier) { create(:dossier, :en_instruction, procedure: procedure) } let(:dossier) { create(:dossier, :en_instruction, procedure: procedure) }
@ -200,7 +200,7 @@ describe Instructeurs::DossiersController, type: :controller do
it { expect(dossier.reload.state).to eq(Dossier.states.fetch(:en_construction)) } it { expect(dossier.reload.state).to eq(Dossier.states.fetch(:en_construction)) }
it { expect(response).to have_http_status(:ok) } it { expect(response).to have_http_status(:ok) }
it { expect(response.body).to include('.sub-header') } it { expect(response.body).to include('.turbo-header') }
context 'when the dossier has already been put en_construction' do context 'when the dossier has already been put en_construction' do
let(:dossier) { create(:dossier, :en_construction, procedure: procedure) } let(:dossier) { create(:dossier, :en_construction, procedure: procedure) }
@ -236,7 +236,7 @@ describe Instructeurs::DossiersController, type: :controller do
context 'when the dossier is refuse' do context 'when the dossier is refuse' do
it { expect(dossier.reload.state).to eq(Dossier.states.fetch(:en_instruction)) } it { expect(dossier.reload.state).to eq(Dossier.states.fetch(:en_instruction)) }
it { expect(response).to have_http_status(:ok) } it { expect(response).to have_http_status(:ok) }
it { expect(response.body).to include('.sub-header') } it { expect(response.body).to include('.turbo-header') }
end end
context 'when the dossier has already been put en_instruction' do context 'when the dossier has already been put en_instruction' do
@ -313,7 +313,7 @@ describe Instructeurs::DossiersController, type: :controller do
expect(dossier.justificatif_motivation).to be_attached expect(dossier.justificatif_motivation).to be_attached
end end
it { expect(subject.body).to include('.sub-header') } it { expect(subject.body).to include('.turbo-header') }
end end
context 'with dossier in batch_operation' do context 'with dossier in batch_operation' do
@ -353,7 +353,7 @@ describe Instructeurs::DossiersController, type: :controller do
subject subject
end end
it { expect(subject.body).to include('.sub-header') } it { expect(subject.body).to include('.turbo-header') }
end end
context 'with attachment' do context 'with attachment' do
@ -367,7 +367,7 @@ describe Instructeurs::DossiersController, type: :controller do
expect(dossier.justificatif_motivation).to be_attached expect(dossier.justificatif_motivation).to be_attached
end end
it { expect(subject.body).to include('.sub-header') } it { expect(subject.body).to include('.turbo-header') }
end end
end end
@ -409,14 +409,14 @@ describe Instructeurs::DossiersController, type: :controller do
end end
it 'The instructeur is sent back to the dossier page' do it 'The instructeur is sent back to the dossier page' do
expect(subject.body).to include('.sub-header') expect(subject.body).to include('.turbo-header')
end end
context 'and the dossier has already an attestation' do context 'and the dossier has already an attestation' do
it 'should not crash' do it 'should not crash' do
dossier.attestation = Attestation.new dossier.attestation = Attestation.new
dossier.save dossier.save
expect(subject.body).to include('.sub-header') expect(subject.body).to include('.turbo-header')
end end
end end
end end
@ -455,7 +455,7 @@ describe Instructeurs::DossiersController, type: :controller do
expect(dossier.justificatif_motivation).to be_attached expect(dossier.justificatif_motivation).to be_attached
end end
it { expect(subject.body).to include('.sub-header') } it { expect(subject.body).to include('.turbo-header') }
end end
end end