Skip to content

Commit

Permalink
Add failing test
Browse files Browse the repository at this point in the history
  • Loading branch information
Qluxzz authored and razzeee committed Feb 27, 2024
1 parent bf31bf8 commit 9fd6e0e
Showing 1 changed file with 54 additions and 0 deletions.
54 changes: 54 additions & 0 deletions test/codeActionTests/addMissingCaseBranches.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -128,4 +128,58 @@ func a =
expectedSource,
);
});

it("should prefix branch variant if needed", async () => {
const source = `
--@ Foo.elm
module Foo exposing (..)
type Foo
= Bar
| Biz
--@ Test.elm
module Test exposing (..)
import Foo
test : Foo -> ()
test response =
case response of
--^
Foo.Bar ->
()
`;

const expectedSource = `
--@ Foo.elm
module Foo exposing (..)
type Foo
= Bar
| Biz
--@ Test.elm
module Test exposing (..)
import Foo
test : Foo -> ()
test response =
case response of
Foo.Bar ->
()
Foo.Biz ->
Debug.todo "branch 'Foo.Biz' not implemented"
`;

await testCodeAction(
source,
[{ title: "Add missing case branches" }],
expectedSource,
);
});
});

0 comments on commit 9fd6e0e

Please sign in to comment.