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: cart_items_system_test.rb
    path of file: ./repos/workarea/storefront/test/system/workarea/storefront
    
    the code of the file until where you have to start completion: require 'test_helper'

module Workarea
  module Storefront
    class CartItemsSystemTest < Workarea::
    
      def test_adding_to_cart
        create_inventory(id: 'SKU1', policy: 'standard', available: 1)

        product = create_product(
          name: 'Integration Product',
          variants: [
            { sku: 'SKU1', regular: 10.to_m },
            { sku: 'SKU2', regular: 20.to_m }
          ]
        )

        visit storefront.product_path(product)

        #
        # No SKU selected
        #

        click_on t('workarea.storefront.products.add_to_cart')

        # Caught by client-side validation
        assert(page.has_content?(t('validate.required')))

        #
        # SKU selected
        #

        select 'SKU1'

        # Click nearby element to blur select menu. Needed in order to clear
        # client-side validation error
        find('h1').click

        within '.page-header__cart-count' do
          assert(page.has_content?('0'))
        end

        click_on t('workarea.storefront.products.add_to_cart')

        within '.ui-dialog' do
          assert(page.has_content?('Success'))
          assert(page.has_content?('Integration Product'))
        end

        within '.page-header__cart-count' do
          assert(page.has_content?('1'))
        end

        #
        # Adding more inventory than available
        #

        visit storefront.product_path(product)
        select 'SKU1'
        click_on t('workarea.storefront.products.add_to_cart')
        assert(page.has_content?(t('workarea.storefront.flash_messages.error')))
      end