Skip to content
This repository has been archived by the owner on Aug 31, 2021. It is now read-only.

Remove style guide and use relative paths for tests #101

Merged
merged 13 commits into from
Mar 17, 2017
Merged

Conversation

tajo
Copy link
Contributor

@tajo tajo commented Mar 17, 2017

Another 100+ files PR but the vast majority of changes is just a replacement of absolute paths in the tests. I was using babel to remap all packages but it turns out that it is a disaster if you start "touching" this repo from other repos.

  • the style guide has been removed, now it lives in our stash/www/cf-styleguide - it's a new shiny app that can automagically run internal and external styles, no symlinks, no extra steps... the only assumption is that all cf-* repos are in the same folder, it's even using postcss as a source of internal styles

That's it. Please LGTM asap.

I'm going to document cf-styleguide since it uses a lot of webpack magic and write a private blog post as well.

@hturan
Copy link
Contributor

hturan commented Mar 17, 2017

-4k lines, that's what I like to see! Good stuff.

So is the plan here to make our cf-ui documentation private? I'm kind of confused around what /docs is, what /styleguide is, what cf-ui-private is and what cf-styleguide is. I'm guessing that you'll clear it all up in the upcoming blog post, but it does make it hard to review this without knowing the overall goal of what we're trying to do here.

package.json Outdated
"test": "cross-env BABEL_ENV=commonjs jest",
"updated": "lerna updated --only-explicit-updates",
"prettier": "node prettier.js",
"clean": "lerna clean --yes && rimraf .jest dist",
"clean": "lerna clean && rimraf dist",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rimraf .jest needs to be part of npm run clean to fix the jest cache issues we were having earlier this week.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also I don't know what --yes does but did you remove it on purpose?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch. My mistake during the rebase.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.


test('.flashRow() should dispatch actions for flashing the row', done => {
// this test is flaky, in 1/4 cases it just time outs
test.skip('.flashRow() should dispatch actions for flashing the row', done => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I run npm test -- --testPathPattern cf-builder-table 10 times without flaky results. Let's hold on with skiping it

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yea, it seems ok now. Fixed.

@sejoker
Copy link
Contributor

sejoker commented Mar 17, 2017

I am ok with changing pathes to relative, but as @hturan mentioned moving styleguide into private repo is something I want to discuss before making a change. It quite important to have open styleguide and within same repo, much easier to test.

@tajo
Copy link
Contributor Author

tajo commented Mar 17, 2017

@hturan @sejoker I'm going to document everything today. The reason why we are removing the styleguide from this repo is to streamline its development. We need to use it for our private styles and private components as well and we don't want to maintain two different versions.

It's pretty hard to have a general styleguide app that could be open sourced right now (in sense of making no assumptions about our internal projects). The priority now is to provide the best DX and seamless integration with cf-ui-private and cf-www-next without running some crazy .sh scripts. That doesn't mean we can't bring it back to public later.

It quite important to have open styleguide and within same repo, much easier to test.

I agree that the styleguide is critical for deving and testing of cf-ui/cf-ui-private components. It's one of its primary goals - to help developers maintain our React components. However, it doesn't have to be in the same repo thanks to some webpack magic.

^^ We were discussing this with @jculvey @jwineman and @toekneestuck.

Copy link
Contributor

@sejoker sejoker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@@ -101,6 +110,6 @@ test('should support flashes', () => {
</Provider>
);
store.dispatch(tableActions.flashRow('test-table', '1', 'success'));
const row = wrapper.find(TableBody).find(TableRow).at(0);
expect(row.prop('type')).toBe('success');
const row = wrapper.find('tbody').find('tr').at(0);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Enzyme was giving me this error:

Method “props” is only meant to be run on a single node. 0 found instead.

Not sure why so I'm testing against the markup.

@@ -86,7 +85,7 @@ test('should should call onPageChange when clicking another page', () => {
/>
);

const items = wrapper.find(PaginationItem);
const items = wrapper.find('li');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

?

Copy link
Contributor Author

@tajo tajo Mar 17, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Explained above. Not sure why Enzyme doesn't like this anymore but the test is still legit (testing the same functionality).

@tajo tajo merged commit 05eaeae into cloudflare:master Mar 17, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants