Skip to content
This repository has been archived by the owner on Feb 22, 2018. It is now read-only.

test(directives) Added more tests for contenteditable directive. And c... #436

Closed
wants to merge 2 commits into from

Conversation

giovannicandido
Copy link
Contributor

Hi,
After some time beating my head trying to make all testes pass. I find that element.isContentEditable do not work.
If someone have some Idea for make the "should NOT update paragraph on html edited" test pass, or maybe is better ignore this.

@mhevery
Copy link
Contributor

mhevery commented Jan 24, 2014

Thanks for your contribution! In order for us to be able to accept it, we ask you to sign our CLA (contributor's license agreement). CLA is important for us to be able to avoid legal troubles down the road.

For individuals (a simple click-through form): http://code.google.com/legal/individual-cla-v1.0.html

@jbdeboer
Copy link
Contributor

@giovannicandido I still don't see a CLA. It is possible you signed it, but the email addresses don't match. Could you reply to this PR when you've signed?

@mhevery
Copy link
Contributor

mhevery commented Jan 27, 2014

Achievement unlocked: CLA signature found!

@giovannicandido
Copy link
Contributor Author

@jbdeboer I sign Again with the email giovanni@atende.info that is the email with the commits

@@ -308,4 +308,20 @@ class ContentEditableDirective extends InputTextLikeDirective {
// The implementation is identical to InputTextLikeDirective but use innerHtml instead of value
get typedValue => (inputElement as dynamic).innerHtml;
set typedValue(String value) => (inputElement as dynamic).innerHtml = (value == null) ? '' : value;

@override
processValue() {
Copy link
Contributor

Choose a reason for hiding this comment

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

Could you explain why this method needs to be overridden? It seems to be identical to the method being overridden except it is not doing validation.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

To this pull request be merge, there is 3 possibilities:
1 remove this peace of code, because as you said it does nothing and let one test fail.
2 override this code to not update content that is not editable, as in the comment isContentEditable() do not work as expected in my tests
3 Remove this code and remove the "should not update test" ignoring this error. The browser don't enable fields for edit, on this case, only direct code can do this.

I leave the code to use the pull request for discussions.

@mhevery
Copy link
Contributor

mhevery commented Jan 27, 2014

Can not merged as tests are failing. Could you get them to pass and let us know.

@ghost ghost assigned mhevery Jan 27, 2014
@jbdeboer
Copy link
Contributor

Punting on this PR for 0.9.5 -> moved to 0.9.6

_.compile("<p contenteditable probe='p'></p>");
_.rootScope.$digest();
Element element = _.rootScope.p.element;
expect(element.isContentEditable).toBeTruthy();
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@mhevery This test fails but shouldn't. This is the source of all problems. Do you think this could be _.compile bug or should I initialise something in the test?

Copy link
Contributor

Choose a reason for hiding this comment

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

I am not sure. I don't have time to further look at this, and it can not be merged in the current state.

If yo think it is a bug can you work around it somehow in the test or file an issue with http://dartlang.org and add link here for reference.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I will dive into it, to locate the origin of problem and submit a bug or solution for the dart team, or the karma team, or find a workaround.

Copy link
Contributor

Choose a reason for hiding this comment

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

awesome!

On Thu, Jan 30, 2014 at 1:51 PM, Giovanni Candido da Silva <
notifications@github.com> wrote:

In test/directive/ng_model_spec.dart:

  •  _.rootScope.$digest();
    
  •  _.rootScope.$apply('model = "Content"');
    
  •  expect((_.rootElement as dom.DivElement).query("p").innerHtml).toEqual('');
    
  • }));
  • /**
  • \* If this test don't pass, several contentEditable test will fail
    
  • */
    
  • it("should the context contenteditable be truthy", inject((){
  •  _.compile("<p contenteditable probe='p'></p>");
    
  •  _.rootScope.$digest();
    
  •  Element element = _.rootScope.p.element;
    
  •  expect(element.isContentEditable).toBeTruthy();
    

I will dive into it, to locate the origin of problem and submit a bug or
solution for the dart team, or the karma team, or find a workaround.


Reply to this email directly or view it on GitHubhttps://github.com//pull/436/files#r9324997
.

@mhevery
Copy link
Contributor

mhevery commented Feb 5, 2014

Ping, any update on this?

@chirayuk
Copy link
Contributor

chirayuk commented Feb 6, 2014

@giovannicandido
Copy link
Contributor Author

Separated tests for the problem:

https://github.com/giovannicandido/darthtml-content-editable-test

@jbdeboer
Copy link
Contributor

Moving to 0.9.8

@jbdeboer jbdeboer modified the milestones: 0.9.8, v0.9.7 Feb 10, 2014
@chirayuk chirayuk modified the milestones: v0.9.9, 0.9.8 Feb 19, 2014
@mhevery
Copy link
Contributor

mhevery commented Feb 25, 2014

Any update on this?

@matsko matsko modified the milestones: 0.9.10, v0.9.9 Mar 10, 2014
@mhevery
Copy link
Contributor

mhevery commented Mar 13, 2014

Closing due to inactivity

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Development

Successfully merging this pull request may close these issues.

None yet

5 participants