Loading...

Във форума е въведено ограничение, което позволява на потребителите единствено да разглеждат публикуваните въпроси.

Ivelinka avatar Ivelinka 24 Точки

03. Movie Theater от JS Advanced Retake Exam - 10 Aug 2022

Здравейте, получавам 70/100, някой може ли да ми помогне ?

Благодаря :)

задача: https://judge.softuni.org/Contests/Practice/Index/3565#2

код: 

describe('movieTheater', () => {
    it(' ageRestrictions', () => {
        expect( movieTheater.ageRestrictions('G') ).to.equal('All ages admitted to watch the movie');
        expect( movieTheater.ageRestrictions('PG') ).to.equal('Parental guidance suggested! Some material may not be suitable for pre-teenagers');
        expect( movieTheater.ageRestrictions('R') ).to.equal('Restricted! Under 17 requires accompanying parent or adult guardian');
        expect( movieTheater.ageRestrictions('NC-17') ).to.equal('No one under 17 admitted to watch the movie');
        expect( movieTheater.ageRestrictions('whatever') ).to.equal('There are no age restrictions for this movie');
    });

    it('moneySpent', () => {
        expect(() => { movieTheater.moneySpent('Z', ['Nachos', 'Popcorn'], ['Soda', 'Water']) }).to.throw('Invalid input');
        expect(() => { movieTheater.moneySpent('Z', 'Z', ['Soda', 'Water']) }).to.throw('Invalid input');
        expect(() => { movieTheater.moneySpent('Z', 'Z', 'Z') }).to.throw('Invalid input');
        expect(() => { movieTheater.moneySpent('Z', ['Soda', 'Water'], 'Z') }).to.throw('Invalid input');
        expect(() => { movieTheater.moneySpent(3, ['Soda', 'Water'], 'Z') }).to.throw('Invalid input');
        expect(() => { movieTheater.moneySpent(350, 'Z', ['Soda', 'Water']) }).to.throw('Invalid input');
        expect(movieTheater.moneySpent(3, ['Nachos', 'Popcorn'], ['Soda', 'Water'])).to.equal(`The total cost for the purchase with applied discount is 47.60`);
        expect(movieTheater.moneySpent(3, ['Nachos'], ['Soda'])).to.equal(`The total cost for the purchase with applied discount is 42.80`);
        expect(movieTheater.moneySpent(2, ['Nachos'], ['Soda'])).to.equal(`The total cost for the purchase is 38.50`);
        expect(movieTheater.moneySpent(2, ['Popcorn'], ['Soda'])).to.equal('The total cost for the purchase is 37.00');
        expect(movieTheater.moneySpent(2, ['Popcorn'], ['Water'])).to.equal('The total cost for the purchase is 36.00');
        expect(movieTheater.moneySpent(2, ['Nachos'], ['Water'])).to.equal('The total cost for the purchase is 37.50');
    });

    it('reservation', () => {
        expect(() => { movieTheater.reservation('3', 3) }).to.throw('Invalid input');
        expect(() => { movieTheater.reservation(['3', 'string'], 1) }).to.throw('Invalid input');
        expect(() => { movieTheater.reservation(['3', 'string'], '3') }).to.throw('Invalid input');
        expect(['23', '25', '27'], 2).to.equal(2); 
    });

})

Тагове:
0
JavaScript Advanced
rosydam avatar rosydam 7 Точки

I want to express my sincere appreciation for the depth of research evident in only up your work, as it has provided me with a comprehensive understanding of the subject matter and fostered a thirst for further exploration.

0
Можем ли да използваме бисквитки?
Ние използваме бисквитки и подобни технологии, за да предоставим нашите услуги. Можете да се съгласите с всички или част от тях.
Назад
Функционални
Използваме бисквитки и подобни технологии, за да предоставим нашите услуги. Използваме „сесийни“ бисквитки, за да Ви идентифицираме временно. Те се пазят само по време на активната употреба на услугите ни. След излизане от приложението, затваряне на браузъра или мобилното устройство, данните се трият. Използваме бисквитки, за да предоставим опцията „Запомни Ме“, която Ви позволява да използвате нашите услуги без да предоставяте потребителско име и парола. Допълнително е възможно да използваме бисквитки за да съхраняваме различни малки настройки, като избор на езика, позиции на менюта и персонализирано съдържание. Използваме бисквитки и за измерване на маркетинговите ни усилия.
Рекламни
Използваме бисквитки, за да измерваме маркетинг ефективността ни, броене на посещения, както и за проследяването дали дадено електронно писмо е било отворено.