table icon indicating copy to clipboard operation
table copied to clipboard

test(angular-table): add test case

Open riccardoperra opened this issue 1 year ago • 2 comments

I'm introducing some test cases to check the FlexRenderDirective and createAngularTable behaviors.

The setup is the same of @tanstack/angular-query, so we are currently using vitest and @analogjs plugin. We can may add in the future some test with angular-testing-library to do some rendering testing like the react package

I have found somes issues to the proxy implementation:

  • we were transforming to computed signals also functions like getCoreRowModel
  • Object.keys(table) and key in table were throwing an error due to the function prototype, so I've updated the proxy target to an arrow function

In a previous commit we also removed the Signal signature to the createAngularTable return type. I've reintroduced it since our table object is both signal and proxy

riccardoperra avatar May 19 '24 10:05 riccardoperra

☁️ Nx Cloud Report

CI is running/has finished running commands for commit bd70b62d434b926a70c48043fbc3d58cf807fe4c. As they complete they will appear below. Click to see the status, the terminal output, and the build insights.

📂 See all runs for this CI Pipeline Execution


✅ Successfully ran 1 target

Sent with 💌 from NxCloud.

nx-cloud[bot] avatar May 19 '24 11:05 nx-cloud[bot]

I can't figure out why I'm getting this error when running the project locally now

image

KevinVandy avatar May 21 '24 23:05 KevinVandy

I'll try to look into it this evening. I did a fast check and had the same error :/

In my previous experiences I had a similiar issue when node_modules was not clean, for example when multiple angular version were installed. Could this be related to the pnpm v9 and nx update? 🤔

riccardoperra avatar May 22 '24 07:05 riccardoperra

Fyi this seems a similar issue https://github.com/angular/angular/issues/55709

riccardoperra avatar May 22 '24 11:05 riccardoperra

@KevinVandy I don't know what happened, but I can confirm to you this is an issue related to some installed deps issue

After doing the below steps in order, I'm now able again to run the examples without any issues :/

  1. remove all node_modules and build folder
find . -path '*/node_modules/*' -delete
find . -path '*/build/*' -delete
  1. remove pnpm-lock.yaml

  2. remove .nx folder

  3. run pnpm store prune --force

  4. run pnpm install

  5. run pnpm build

I updated all package.json in order to have the same installed angular version (17.3.9)


IMPORTANT

This thing make me crazy 😄 Updating angular with the same version is not enough. I have to remove also pnpm-lock.yaml and recreate everything from scratch. Unfortunately this cause some issues while building the qwik demos which break the CI (look to the previous run error https://github.com/TanStack/table/actions/runs/9197713380)

EDIT 2

Everything seems working in my machine and in the CI after pnpm dedupe, but I don't know if this is ok for you. https://pnpm.io/cli/dedupe

riccardoperra avatar May 22 '24 20:05 riccardoperra