Sha256: 3410b7f646ced873553e3814d1cb7387b95e3f7785fde2a57f46d5d9a58e4d85

Contents?: true

Size: 533 Bytes

Versions: 30

Compression:

Stored size: 533 Bytes

Contents

# frozen_string_literal: true

module Ariadne
  # Module to allow components to deal with the `test_selector` argument.
  # It will only add the selector if env is not Production.
  #
  # test_selector: "foo" => data-test-selector="foo"
  module TestSelectorHelper
    TEST_SELECTOR_TAG = :test_selector

    def add_test_selector(args)
      if args.key?(TEST_SELECTOR_TAG)
        args[:data] ||= {}
        args[:data][TEST_SELECTOR_TAG] = args[TEST_SELECTOR_TAG]
      end

      args.except(TEST_SELECTOR_TAG)
    end
  end
end

Version data entries

30 entries across 30 versions & 1 rubygems

Version Path
ariadne_view_components-0.0.12 app/lib/ariadne/test_selector_helper.rb
ariadne_view_components-0.0.12-x86_64-linux app/lib/ariadne/test_selector_helper.rb
ariadne_view_components-0.0.12-x86_64-darwin app/lib/ariadne/test_selector_helper.rb
ariadne_view_components-0.0.12-x64-mingw32 app/lib/ariadne/test_selector_helper.rb
ariadne_view_components-0.0.12-x64-mingw-ucrt app/lib/ariadne/test_selector_helper.rb
ariadne_view_components-0.0.12-arm64-darwin app/lib/ariadne/test_selector_helper.rb
ariadne_view_components-0.0.12-aarch64-linux app/lib/ariadne/test_selector_helper.rb
ariadne_view_components-0.0.11 app/lib/ariadne/test_selector_helper.rb
ariadne_view_components-0.0.11-x86_64-linux app/lib/ariadne/test_selector_helper.rb
ariadne_view_components-0.0.11-x86_64-darwin app/lib/ariadne/test_selector_helper.rb
ariadne_view_components-0.0.11-x64-mingw32 app/lib/ariadne/test_selector_helper.rb
ariadne_view_components-0.0.11-x64-mingw-ucrt app/lib/ariadne/test_selector_helper.rb
ariadne_view_components-0.0.11-arm64-darwin app/lib/ariadne/test_selector_helper.rb
ariadne_view_components-0.0.11-aarch64-linux app/lib/ariadne/test_selector_helper.rb
ariadne_view_components-0.0.10 app/lib/ariadne/test_selector_helper.rb
ariadne_view_components-0.0.10-x86_64-linux app/lib/ariadne/test_selector_helper.rb
ariadne_view_components-0.0.10-x86_64-darwin app/lib/ariadne/test_selector_helper.rb
ariadne_view_components-0.0.10-x64-mingw32 app/lib/ariadne/test_selector_helper.rb
ariadne_view_components-0.0.10-x64-mingw-ucrt app/lib/ariadne/test_selector_helper.rb
ariadne_view_components-0.0.10-arm64-darwin app/lib/ariadne/test_selector_helper.rb