<commit_before>package com.jvm_bloggers.frontend.public_area.newsletter_issue

import com.googlecode.wicket.jquery.ui.markup.html.link.BookmarkablePageLink
import com.jvm_bloggers.MockSpringContextAwareSpecification
import com.jvm_bloggers.domain.query.NewsletterIssueNumber
import com.jvm_bloggers.domain.query.published_newsletter_issue.PublishedNewsletterIssue
import com.jvm_bloggers.frontend.public_area.common_layout.RightFrontendSidebarBackingBean
import com.jvm_bloggers.frontend.public_area.newsletter_issue.newsletter_panel.NewsletterIssuePanel
import javaslang.control.Option
import org.apache.wicket.markup.html.basic.Label
import org.springframework.web.util.HtmlUtils
import spock.lang.Subject

import static com.jvm_bloggers.domain.query.NewsletterIssueNumber.of
import static com.jvm_bloggers.frontend.public_area.newsletter_issue.NewsletterIssuePage.ISSUE_PANEL_ID
import static com.jvm_bloggers.frontend.public_area.newsletter_issue.NewsletterIssuePage.buildShowIssueParams
import static com.jvm_bloggers.frontend.public_area.newsletter_issue.NewsletterIssuePage.buildShowIssueParams
import static java.lang.String.format
import static java.time.LocalDate.now
import static javaslang.collection.List.empty

class NewsletterIssuePageSpec extends MockSpringContextAwareSpecification {

    NewsletterIssuePageBackingBean backingBean = Stub(NewsletterIssuePageBackingBean)
    RightFrontendSidebarBackingBean sidebarBackingBean = Stub(RightFrontendSidebarBackingBean)

    @Override
    protected void setupContext() {
        addBean(backingBean)
        addBean(sidebarBackingBean)
    }

    def "Should display selected issue"() {
        given:
        PublishedNewsletterIssue issue = prepareExampleIssue()
        backingBean.findByIssueNumber(issue.number) >> Option.of(issue)

        when:
        tester.startPage(NewsletterIssuePage, buildShowIssueParams(issue.number))

        then:
        tester.assertComponent(ISSUE_PANEL_ID, NewsletterIssuePanel)
        tester.assertContains("Wydanie #${issue.number.asLong()}")<commit_msg>[minor] Remove unused imports from NewsletterIssuePageSpec<commit_after>package com.jvm_bloggers.frontend.public_area.newsletter_issue

import com.jvm_bloggers.MockSpringContextAwareSpecification
import com.jvm_bloggers.domain.query.NewsletterIssueNumber
import com.jvm_bloggers.domain.query.published_newsletter_issue.PublishedNewsletterIssue
import com.jvm_bloggers.frontend.public_area.common_layout.RightFrontendSidebarBackingBean
import com.jvm_bloggers.frontend.public_area.newsletter_issue.newsletter_panel.NewsletterIssuePanel
import javaslang.control.Option
import org.apache.wicket.markup.html.basic.Label
import spock.lang.Subject

import static com.jvm_bloggers.domain.query.NewsletterIssueNumber.of
import static com.jvm_bloggers.frontend.public_area.newsletter_issue.NewsletterIssuePage.ISSUE_PANEL_ID
import static com.jvm_bloggers.frontend.public_area.newsletter_issue.NewsletterIssuePage.buildShowIssueParams
import static java.time.LocalDate.now
import static javaslang.collection.List.empty

class NewsletterIssuePageSpec extends MockSpringContextAwareSpecification {

    NewsletterIssuePageBackingBean backingBean = Stub(NewsletterIssuePageBackingBean)
    RightFrontendSidebarBackingBean sidebarBackingBean = Stub(RightFrontendSidebarBackingBean)

    @Override
    protected void setupContext() {
        addBean(backingBean)
        addBean(sidebarBackingBean)
    }

    def "Should display selected issue"() {
        given:
        PublishedNewsletterIssue issue = prepareExampleIssue()
        backingBean.findByIssueNumber(issue.number) >> Option.of(issue)

        when:
        tester.startPage(NewsletterIssuePage, buildShowIssueParams(issue.number))

        then:
        tester.assertComponent(ISSUE_PANEL_ID, NewsletterIssuePanel)
        tester.assertContains("Wydanie #${issue.number.asLong()}")
{'fraction_non_alphanumeric': 0.06860226104830422, 'fraction_numerical': 0.0, 'mean_word_length': 6.1170018281535645, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2684369', 'n_tokens_mistral': 1186, 'n_tokens_neox': 1130, 'n_words': 150}