From 4eb1f536c3773855a00653ad4c779b231e14ac3c Mon Sep 17 00:00:00 2001 From: Kirk Wang Date: Tue, 14 Jan 2025 11:59:44 -0800 Subject: [PATCH] =?UTF-8?q?=E2=9C=85=20Fix=20flaky=20work=5Fshow=5Fpresent?= =?UTF-8?q?er=5Fspec?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This commit will ensure that the state of the test_strategy tenant is returned to its default after the test runs because we were seeing this interfere with other tests it was left set on non-default. --- spec/presenters/hyku/work_show_presenter_spec.rb | 3 +++ 1 file changed, 3 insertions(+) diff --git a/spec/presenters/hyku/work_show_presenter_spec.rb b/spec/presenters/hyku/work_show_presenter_spec.rb index 50224879f..b4da6a4a3 100644 --- a/spec/presenters/hyku/work_show_presenter_spec.rb +++ b/spec/presenters/hyku/work_show_presenter_spec.rb @@ -7,6 +7,7 @@ let(:request) { double(base_url: 'http://test.host', host: 'http://test.host') } let(:ability) { nil } let(:presenter) { described_class.new(solr_document, ability, request) } + let(:default_pdf_viewer_value) { Flipflop::FeatureSet.current.feature(:default_pdf_viewer).default } describe "#manifest_url" do subject { presenter.manifest_url } @@ -39,6 +40,8 @@ let!(:test_strategy) { Flipflop::FeatureSet.current.test! } before { allow_any_instance_of(Hyrax::IiifAv::IiifFileSetPresenter).to receive(:pdf?).and_return true } + # Return state of the tenant to the default after test suite + after { test_strategy.switch!(:default_pdf_viewer, default_pdf_viewer_value) } context 'when the tenant is not configured to use IIIF Print' do before { test_strategy.switch!(:default_pdf_viewer, true) }