You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: add_work_item_widget_shared_examples.rb
    path of file: ./repos/gitlabhq/spec/support/shared_examples/migrations
    
    the code of the file until where you have to start completion: # frozen_string_literal: true

RSpec.shared_examples 'migration that adds widget to work items definitions' do |widget_name:, work_item_types:|
  let(:migration) { described_class.new }
  let(:work_item_definitions) { table(:work_item_widget_definitions) }
  let(:work_item_type_count) { work_item_types.size }

  describe '#up' do
    it "creates widget definition in all types" do
      work_item_definiti
    
  def reset_db_state_prior_to_migration
    work_item_types.delete_all

    base_types.each do |type_sym, type_enum|
      create_work_item_type!(type_sym.to_s.titleize, type_enum)
    end

    target_type_record = work_item_types.find_by_name(target_type.to_s.titleize)

    widgets = widgets_for_type.map do |widget_name_value, widget_enum_value|
      {
        work_item_type_id: target_type_record.id,
        name: widget_name_value,
        widget_type: widget_enum_value
      }
    end

    # Creating all widgets for the type so the state in the DB is as close as possible to the actual state
    work_item_widget_definitions.upsert_all(
      widgets,
      unique_by: :index_work_item_widget_definitions_on_default_witype_and_name
    )
  end