CSS styles packed by webpacker not applied in test even system spec

I am running system specs with firefox or chome driver. In the window I could see that the css styles are not applied.

Here is the head of the layout:

<%# Using webpacker to pack the stylesheets %>
<%= stylesheet_pack_tag "application", media: "all", 'data-turbolinks-track': 'reload' %>
<%# Using webpacker to pack the javascripts %> 
<%= javascript_pack_tag "application", defer: true, 'data-turbolinks-track': 'reload' %>

This is different from the parts of our app that are packing with sprockets.

Does anyone know what might be causing this? I though it is the defer option, but even without it it the content is still not styled

On the similar subject, do you know if there is a way to make capybara wait for all the defered scripts to be executed by the browser and only then start the specs.

Update 1

It seems that stylesheet_pack_tag does not work in a test env. The generate header is

<head>
  <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
  <meta http-equiv="x-ua-compatible" content="ie=edge">
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  <title>XXX</title>
  <meta name="action-cable-url" content="/cable">

  <link rel="shortcut icon" href="../../favicon.ico">

  <link rel="stylesheet" href="//fonts.googleapis.com/css?family=Open+Sans%3A400%2C300%2C500%2C600%2C700%7CPlayfair+Display%7CRoboto%7CRaleway%7CSpectral%7CRubik">
  <script src="/packs-test/application-2d0c3ccc0376798e9410.js" defer="defer" data-turbolinks-track="reload"></script>
</head>

Found it. There should be

# config/webpacker.yml

extract_css: true 

for the test env