feat(import): confirm column mapping in a preview before importing members
This commit is contained in:
parent
a93dd9d535
commit
68a1a9530a
8 changed files with 816 additions and 38 deletions
31
test/mv_web/live/import_live/components_test.exs
Normal file
31
test/mv_web/live/import_live/components_test.exs
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
defmodule MvWeb.ImportLive.ComponentsTest do
|
||||
use ExUnit.Case, async: true
|
||||
|
||||
alias MvWeb.ImportLive.Components
|
||||
|
||||
describe "import_button_disabled?/2" do
|
||||
@done_entry %{done?: true}
|
||||
|
||||
test "disables the Start Import button while the preview is displayed" do
|
||||
# During :preview the upload entry is done, but re-clicking Start Import
|
||||
# would re-run the upload processing and overwrite the current preview.
|
||||
assert Components.import_button_disabled?(:preview, [@done_entry]) == true
|
||||
end
|
||||
|
||||
test "disables the button while an import is running" do
|
||||
assert Components.import_button_disabled?(:running, [@done_entry]) == true
|
||||
end
|
||||
|
||||
test "disables the button when there are no upload entries" do
|
||||
assert Components.import_button_disabled?(:idle, []) == true
|
||||
end
|
||||
|
||||
test "disables the button while an upload entry is not yet done" do
|
||||
assert Components.import_button_disabled?(:idle, [%{done?: false}]) == true
|
||||
end
|
||||
|
||||
test "enables the button at idle with a completed upload" do
|
||||
assert Components.import_button_disabled?(:idle, [@done_entry]) == false
|
||||
end
|
||||
end
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue