Skip to content

Add Projections for LiveComponent and JSON View Controllers #80

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

zolrath
Copy link
Contributor

@zolrath zolrath commented May 5, 2023

From what I can tell the JSON view controller can be fairly light and doesn't have the same level of structure as the HTML view controller, but I've added it as well as a Live Component projection!

@mhanberg
Copy link
Collaborator

mhanberg commented May 9, 2023

I'd like to get some basic unit tests written for this and #85, but it'll require some test fixtures.

once the tests for #88 are written, we can rebase on main and then i can contribute them to this PR or you can take a crack at them if you'd like.

@zolrath
Copy link
Contributor Author

zolrath commented May 9, 2023

Sounds good! I've never made tests for a neovim plugin but if you have examples of tests for other projections I can definitely add them as needed for the PR!

@mhanberg
Copy link
Collaborator

mhanberg commented May 9, 2023

I'm sort of in the same boat, as the existing tests are more or less basic unit tests of lua code, whereas the tests i'd like to write for this actually make neovim do stuff.

@mhanberg
Copy link
Collaborator

Some test fixtures were just merged into main, so if you rebase you should be able to utilize them to write some tests

@zolrath zolrath force-pushed the projectionist-live-component-json-view branch from 5d07ace to 5afed24 Compare May 17, 2023 21:04
@zolrath
Copy link
Contributor Author

zolrath commented May 18, 2023

Some test fixtures were just merged into main, so if you rebase you should be able to utilize them to write some tests

Okay great! Do you have an example of how you're running the current tests? Not quite sure how that's being orchestrated and it doesn't seem documented yet!

From what I can tell it's likely something akin to:

nvim --headless -c "PlenaryBustedDirectory tests/ {minimal_init = 'support/minimal_init.vim'}"

but it would be nice to be sure!

Seems like I'd need to independently have Plenary installed in my vim config for that?

@mhanberg
Copy link
Collaborator

There is a script in bin called test-local.

And yes plenary has to be in your config, but I believe the plug-in needs it so you should already have it.

@mhanberg
Copy link
Collaborator

mhanberg commented Jun 7, 2023

@zolrath when #108 merges, you should have a foundation for adding projectionist tests.

you can run the tests with bin/test or bin/test path/to/file.

You should run this with >= 0.9 for it to work well.

I'm copy pasting this comment to your other PR

@mhanberg mhanberg force-pushed the projectionist-live-component-json-view branch from 9c0d99d to 8757d9f Compare June 11, 2023 03:10
@mhanberg mhanberg enabled auto-merge (squash) June 11, 2023 03:11
@mhanberg mhanberg force-pushed the projectionist-live-component-json-view branch from 8757d9f to e28589e Compare June 11, 2023 03:21
@mhanberg mhanberg disabled auto-merge June 11, 2023 03:57
@mhanberg mhanberg merged commit 7af93b7 into elixir-tools:main Jun 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants