Skip to content

Commit

Permalink
[shallow] fixed shallow rendering
Browse files Browse the repository at this point in the history
  • Loading branch information
plusgut committed Apr 22, 2018
1 parent 2ee4c81 commit a20fb28
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"@types/enzyme": "3.1.9",
"concurrently": "3.5.1",
"enzyme": "3.3.0",
"plusnew": "0.5.94",
"plusnew": "0.5.95",
"plusnew-karma-config": "0.5.69",
"plusnew-webpack-config": "0.5.93",
"tslint": "5.9.1",
Expand Down
1 change: 1 addition & 0 deletions src/wrapper/PlusnewMountWrapper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ export default class PlusnewMountWrapper extends PlusnewCommonWrapper {
constructor(wrapper: ReactWrapper) {
super();
this.wrapper = wrapper;
this.length = this.wrapper.length;
}

public detach(): void {
Expand Down
1 change: 1 addition & 0 deletions src/wrapper/PlusnewShallowWrapper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ class PlusnewShallowWrapper extends PlusnewCommonWrapper {
constructor(wrapper: ShallowWrapper) {
super();
this.wrapper = wrapper;
this.length = this.wrapper.length;
}

public dive(): this {
Expand Down
3 changes: 1 addition & 2 deletions test/shallow.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import plusnew, { component } from 'plusnew';

configure({ adapter: new enzymeAdapterPlusnew() });

xdescribe('test shallow', () => {
describe('test shallow', () => {
it('button should be findable', () => {
const Component = component(
() => ({}),
Expand All @@ -30,7 +30,6 @@ xdescribe('test shallow', () => {
);

const wrapper = shallow(<Component />);
expect(wrapper.find(Component).length).toBe(1);
expect(wrapper.contains(<NestedComponent />)).toBe(true);
expect(wrapper.contains(<button />)).toBe(false);
expect(wrapper.find(NestedComponent).length).toBe(1);
Expand Down
6 changes: 3 additions & 3 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4624,9 +4624,9 @@ plusnew-webpack-config@0.5.93:
webpack "4.5.0"
webpack-cli "2.0.14"

plusnew@0.5.94:
version "0.5.94"
resolved "https://registry.yarnpkg.com/plusnew/-/plusnew-0.5.94.tgz#d4640555ad58735555b3449548f7fbed6d16e387"
plusnew@0.5.95:
version "0.5.95"
resolved "https://registry.yarnpkg.com/plusnew/-/plusnew-0.5.95.tgz#b8ece115ae07a9a8c2371cd00bf0ca7b8204dc61"
dependencies:
redchain "0.5.73"

Expand Down

0 comments on commit a20fb28

Please sign in to comment.