summaryrefslogtreecommitdiff
path: root/tests/unit/mainwindow/statusbar/test_tabindex.py
blob: a2b38db9fa2f852bd417cef7524bbd34780eebfc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# SPDX-FileCopyrightText: Florian Bruhin (The Compiler) <mail@qutebrowser.org>
#
# SPDX-License-Identifier: GPL-3.0-or-later

"""Test TabIndex widget."""

import pytest

from qutebrowser.mainwindow.statusbar.tabindex import TabIndex


@pytest.fixture
def tabindex(qtbot):
    widget = TabIndex()
    qtbot.add_widget(widget)
    return widget


def test_tab_change(tabindex):
    """Make sure the tab index gets set correctly when switching tabs."""
    tabindex.on_tab_index_changed(0, 2)
    assert tabindex.text() == '[1/2]'