Skip to content

Commit

Permalink
try to pass tests by giving "value" to a secret
Browse files Browse the repository at this point in the history
  • Loading branch information
c-m-duncan committed Jan 3, 2023
1 parent 4522472 commit cde67ef
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,15 @@ defmodule AndiWeb.ExtractSteps.ExtractSecretStepForm do
<div class="extract-secret-step-form-edit-section form-grid">
<div class="extract-secret-step-form__destination">
<%= label(f, :destination, DisplayNames.get(:destination), class: "label label--required") %>
<%= label(f, :destination, DisplayNames.get(:destination), class: "label label--required", for: "step_#{@id}__secret_destination") %>
<%= text_input(f, :destination, [id: "step_#{@id}__secret_destination", class: "extract-secret-step-form__destination input", phx_target: "#step-#{@id}", required: true]) %>
<%= ErrorHelpers.error_tag(f, :destination) %>
</div>
<div class="extract-secret-step-form__value">
<%= label(f, :secret_value, DisplayNames.get(:secret_value), class: "label label--required") %>
<%= label(f, :secret_value, DisplayNames.get(:secret_value), class: "label label--required", for: "step_#{@id}__secret_value") %>
<div class="secret_value_add">
<%= text_input(f, :secret_value, [id: "step_#{@id}__secret_destination", type: "password", class: "extract-secret-step-form__secret-value input", phx_target: "#step-#{@id}", placeholder: "Secrets are not displayed after being saved", required: true]) %>
<%= text_input(f, :secret_value, [id: "step_#{@id}__secret_value", type: "password", class: "extract-secret-step-form__secret-value input", phx_target: "#step-#{@id}", placeholder: "Secrets are not displayed after being saved", required: true]) %>
<% secret_value = FormData.input_value(nil, f, :secret_value) %>
<button type="button" class="btn btn--action" phx-click="save_secret" <%= disable_add_button(@changeset, secret_value) %> phx-target='<%="#step-#{@id}"%>' phx-value-secret="<%= secret_value %>">Add</button>
<span class="secret__status-msg <%= save_success_class(@save_success) %>"><%= @save_secret_message %></span>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,7 @@ defmodule AndiWeb.ExtractHttpStepFormTest do
"secret",
%{
destination: "secret",
value: "value",
key: "secret1-key",
sub_key: "secret1-sub-key"
}
Expand All @@ -260,6 +261,7 @@ defmodule AndiWeb.ExtractHttpStepFormTest do
"secret",
%{
destination: "secret2",
value: "value",
key: "secret2-key",
sub_key: "secret2-sub-key"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ defmodule AndiWeb.ExtractSecretFormTest do

default_context = %{
destination: "bob_field",
secret_value: "value",
sub_key: "secret-key"
}

Expand Down

0 comments on commit cde67ef

Please sign in to comment.