Reprograma - Imersão JS On25 - Atividade da Semana 1 - Jest - Elvira Bruno#22
Open
elvirabl wants to merge 1 commit into
Open
Reprograma - Imersão JS On25 - Atividade da Semana 1 - Jest - Elvira Bruno#22elvirabl wants to merge 1 commit into
elvirabl wants to merge 1 commit into
Conversation
marcelabino
reviewed
Jun 30, 2023
| } | ||
|
|
||
| saque(Valor) { | ||
| if (Valor <= this.saldo) { |
There was a problem hiding this comment.
Seria bom fazer uma verificação para não aceitar valores negativos.
Author
There was a problem hiding this comment.
obrigada, irei providenciar, gostei muito da sua ideia.
marcelabino
reviewed
Jun 30, 2023
| this.saldo -= Valor; | ||
| } else if (Valor <= this.saldo + this.limite) { | ||
| this.saldo -= Valor; | ||
| } |
There was a problem hiding this comment.
Você poderia fazer mais um if para retornar a mensagem de "Saldo insuficiente".
| expect(contaIndividual.Saldo()).toBe(-500); | ||
| }); | ||
|
|
||
| test("Saque com saldo insuficiente e limite indisponível", () => { |
There was a problem hiding this comment.
A função não retorna saldo insuficiente.
Marianaliima
reviewed
Jul 3, 2023
Marianaliima
left a comment
Collaborator
There was a problem hiding this comment.
olá tudo bem? parabéns pela construção do código, ficou muito boa. além dos comentários de sua colega de turma. Se usasse beforeEach seria mais fácil nos teses para não ter que instanciar uma nova classe em cada teste
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Criação de uma classe, representando uma conta bancária, com somente, nome, saldo e limite.
Operações de consultar saldo, debito e crédito em conta, cheque especial e desabilitação da conta.
Testado aplicados com Jest.
Agradeço a Professora Sra. Mariana e colegas de sala pela paciência e um grande pedido de desculpas pelas minhas falhas.